Home | History | Annotate | Download | only in frame
      1 /*
      2     Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
      3 
      4     This library is free software; you can redistribute it and/or
      5     modify it under the terms of the GNU Library General Public
      6     License as published by the Free Software Foundation; either
      7     version 2 of the License, or (at your option) any later version.
      8 
      9     This library is distributed in the hope that it will be useful,
     10     but WITHOUT ANY WARRANTY; without even the implied warranty of
     11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     12     Library General Public License for more details.
     13 
     14     You should have received a copy of the GNU Library General Public License
     15     along with this library; see the file COPYING.LIB.  If not, write to
     16     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
     17     Boston, MA 02110-1301, USA.
     18 */
     19 
     20 #ifndef Navigator_h
     21 #define Navigator_h
     22 
     23 #include "bindings/core/v8/ScriptWrappable.h"
     24 #include "core/frame/DOMWindowProperty.h"
     25 #include "core/frame/NavigatorCPU.h"
     26 #include "core/frame/NavigatorID.h"
     27 #include "core/frame/NavigatorLanguage.h"
     28 #include "core/frame/NavigatorOnLine.h"
     29 #include "platform/Supplementable.h"
     30 #include "platform/heap/Handle.h"
     31 #include "wtf/Forward.h"
     32 #include "wtf/PassRefPtr.h"
     33 #include "wtf/RefCounted.h"
     34 #include "wtf/RefPtr.h"
     35 
     36 namespace blink {
     37 
     38 class DOMMimeTypeArray;
     39 class DOMPluginArray;
     40 class LocalFrame;
     41 
     42 typedef int ExceptionCode;
     43 
     44 class Navigator FINAL
     45     : public RefCountedWillBeGarbageCollectedFinalized<Navigator>
     46     , public NavigatorCPU
     47     , public NavigatorID
     48     , public NavigatorLanguage
     49     , public NavigatorOnLine
     50     , public ScriptWrappable
     51     , public DOMWindowProperty
     52     , public WillBeHeapSupplementable<Navigator> {
     53     DEFINE_WRAPPERTYPEINFO();
     54     WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Navigator);
     55 public:
     56     static PassRefPtrWillBeRawPtr<Navigator> create(LocalFrame* frame)
     57     {
     58         return adoptRefWillBeNoop(new Navigator(frame));
     59     }
     60 
     61     virtual ~Navigator();
     62 
     63     DOMPluginArray* plugins() const;
     64     DOMMimeTypeArray* mimeTypes() const;
     65     bool cookieEnabled() const;
     66     bool javaEnabled() const;
     67 
     68     String productSub() const;
     69     String vendor() const;
     70     String vendorSub() const;
     71 
     72     virtual String userAgent() const OVERRIDE;
     73 
     74     // Relinquishes the storage lock, if one exists.
     75     void getStorageUpdates();
     76 
     77     // NavigatorLanguage
     78     virtual Vector<String> languages() OVERRIDE;
     79 
     80     virtual void trace(Visitor*) OVERRIDE;
     81 
     82 private:
     83     explicit Navigator(LocalFrame*);
     84 
     85     mutable RefPtrWillBeMember<DOMPluginArray> m_plugins;
     86     mutable RefPtrWillBeMember<DOMMimeTypeArray> m_mimeTypes;
     87 };
     88 
     89 } // namespace blink
     90 
     91 #endif // Navigator_h
     92