OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NavigatorVRDevice_h | 5 #ifndef NavigatorVRDevice_h |
6 #define NavigatorVRDevice_h | 6 #define NavigatorVRDevice_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "core/frame/DOMWindowProperty.h" | 9 #include "core/frame/DOMWindowProperty.h" |
10 #include "modules/ModulesExport.h" | 10 #include "modules/ModulesExport.h" |
11 #include "modules/vr/VRDevice.h" | 11 #include "modules/vr/VRDevice.h" |
12 #include "modules/vr/VRHardwareUnit.h" | 12 #include "modules/vr/VRHardwareUnit.h" |
13 #include "platform/Supplementable.h" | 13 #include "platform/Supplementable.h" |
14 #include "platform/heap/Handle.h" | 14 #include "platform/heap/Handle.h" |
15 #include "public/platform/WebVector.h" | 15 #include "public/platform/WebVector.h" |
16 #include "wtf/Noncopyable.h" | 16 #include "wtf/Noncopyable.h" |
17 | 17 |
18 namespace blink { | 18 namespace blink { |
19 | 19 |
20 class Document; | 20 class Document; |
21 class Navigator; | 21 class Navigator; |
22 class VRController; | 22 class VRController; |
23 class VRHardwareUnitCollection; | 23 class VRHardwareUnitCollection; |
24 | 24 |
25 class MODULES_EXPORT NavigatorVRDevice final : public NoBaseWillBeGarbageCollect
edFinalized<NavigatorVRDevice>, public WillBeHeapSupplement<Navigator>, public D
OMWindowProperty { | 25 // TODO(Oilpan): when ~DOMWindowProperty is removed, derive from GarbageCollecte
d<> instead. |
26 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorVRDevice); | 26 class MODULES_EXPORT NavigatorVRDevice final : public GarbageCollectedFinalized<
NavigatorVRDevice>, public HeapSupplement<Navigator>, DOMWindowProperty { |
| 27 USING_GARBAGE_COLLECTED_MIXIN(NavigatorVRDevice); |
27 WTF_MAKE_NONCOPYABLE(NavigatorVRDevice); | 28 WTF_MAKE_NONCOPYABLE(NavigatorVRDevice); |
28 public: | 29 public: |
29 static NavigatorVRDevice* from(Document&); | 30 static NavigatorVRDevice* from(Document&); |
30 static NavigatorVRDevice& from(Navigator&); | 31 static NavigatorVRDevice& from(Navigator&); |
31 virtual ~NavigatorVRDevice(); | 32 virtual ~NavigatorVRDevice(); |
32 | 33 |
33 static ScriptPromise getVRDevices(ScriptState*, Navigator&); | 34 static ScriptPromise getVRDevices(ScriptState*, Navigator&); |
34 ScriptPromise getVRDevices(ScriptState*); | 35 ScriptPromise getVRDevices(ScriptState*); |
35 | 36 |
36 VRController* controller(); | 37 VRController* controller(); |
37 | 38 |
38 DECLARE_VIRTUAL_TRACE(); | 39 DECLARE_VIRTUAL_TRACE(); |
39 | 40 |
40 private: | 41 private: |
41 friend class VRHardwareUnit; | 42 friend class VRHardwareUnit; |
42 friend class VRGetDevicesCallback; | 43 friend class VRGetDevicesCallback; |
43 | 44 |
44 explicit NavigatorVRDevice(LocalFrame*); | 45 explicit NavigatorVRDevice(LocalFrame*); |
45 | 46 |
46 static const char* supplementName(); | 47 static const char* supplementName(); |
47 | 48 |
48 RefPtrWillBeMember<VRHardwareUnitCollection> m_hardwareUnits; | 49 Member<VRHardwareUnitCollection> m_hardwareUnits; |
49 }; | 50 }; |
50 | 51 |
51 } // namespace blink | 52 } // namespace blink |
52 | 53 |
53 #endif // NavigatorVRDevice_h | 54 #endif // NavigatorVRDevice_h |
OLD | NEW |