OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 11 matching lines...) Expand all Loading... |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef WorkerNavigator_h | 26 #ifndef WorkerNavigator_h |
27 #define WorkerNavigator_h | 27 #define WorkerNavigator_h |
28 | 28 |
29 #include "bindings/core/v8/ScriptWrappable.h" | 29 #include "bindings/core/v8/ScriptWrappable.h" |
30 #include "core/frame/NavigatorCPU.h" | 30 #include "core/frame/NavigatorCPU.h" |
31 #include "core/frame/NavigatorID.h" | 31 #include "core/frame/NavigatorID.h" |
| 32 #include "core/frame/NavigatorLanguage.h" |
32 #include "core/frame/NavigatorOnLine.h" | 33 #include "core/frame/NavigatorOnLine.h" |
33 #include "platform/Supplementable.h" | 34 #include "platform/Supplementable.h" |
34 #include "platform/heap/Handle.h" | 35 #include "platform/heap/Handle.h" |
35 #include "wtf/PassRefPtr.h" | 36 #include "wtf/PassRefPtr.h" |
36 #include "wtf/RefCounted.h" | 37 #include "wtf/RefCounted.h" |
37 #include "wtf/text/WTFString.h" | 38 #include "wtf/text/WTFString.h" |
38 | 39 |
39 namespace blink { | 40 namespace blink { |
40 | 41 |
41 class WorkerNavigator FINAL : public RefCountedWillBeGarbageCollectedFinalized<W
orkerNavigator>, public ScriptWrappable, public NavigatorCPU, public NavigatorID
, public NavigatorOnLine, public WillBeHeapSupplementable<WorkerNavigator> { | 42 |
| 43 class WorkerNavigator FINAL : public RefCountedWillBeGarbageCollectedFinalized<W
orkerNavigator>, public ScriptWrappable, public NavigatorCPU, public NavigatorID
, public NavigatorOnLine, public NavigatorLanguage, public WillBeHeapSupplementa
ble<WorkerNavigator> { |
42 DEFINE_WRAPPERTYPEINFO(); | 44 DEFINE_WRAPPERTYPEINFO(); |
43 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WorkerNavigator); | 45 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WorkerNavigator); |
44 public: | 46 public: |
45 static PassRefPtrWillBeRawPtr<WorkerNavigator> create(const String& userAgen
t) | 47 static PassRefPtrWillBeRawPtr<WorkerNavigator> create(const String& userAgen
t) |
46 { | 48 { |
47 return adoptRefWillBeNoop(new WorkerNavigator(userAgent)); | 49 return adoptRefWillBeNoop(new WorkerNavigator(userAgent)); |
48 } | 50 } |
49 virtual ~WorkerNavigator(); | 51 virtual ~WorkerNavigator(); |
50 | 52 |
51 virtual String userAgent() const OVERRIDE; | 53 virtual String userAgent() const OVERRIDE; |
52 | 54 |
| 55 void setUserPreferredLanguagesForWorkers(const Vector<String>&); |
| 56 |
| 57 virtual AtomicString language() OVERRIDE; |
| 58 |
| 59 virtual Vector<String> languages() OVERRIDE; |
| 60 |
53 void trace(Visitor*); | 61 void trace(Visitor*); |
54 | 62 |
55 private: | 63 private: |
56 explicit WorkerNavigator(const String&); | 64 explicit WorkerNavigator(const String&); |
57 | 65 |
58 String m_userAgent; | 66 String m_userAgent; |
| 67 |
| 68 Vector<String> m_userPreferredLanguages; |
59 }; | 69 }; |
60 | 70 |
61 } // namespace blink | 71 } // namespace blink |
62 | 72 |
63 #endif // WorkerNavigator_h | 73 #endif // WorkerNavigator_h |
OLD | NEW |