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 VRController_h | 5 #ifndef VRController_h |
6 #define VRController_h | 6 #define VRController_h |
7 | 7 |
8 #include "core/frame/LocalFrameLifecycleObserver.h" | 8 #include "core/frame/LocalFrameLifecycleObserver.h" |
9 #include "platform/Supplementable.h" | 9 #include "platform/Supplementable.h" |
10 #include "public/platform/WebVR.h" | 10 #include "public/platform/WebVR.h" |
11 #include "public/platform/WebVRClient.h" | 11 #include "public/platform/WebVRClient.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class VRController final | 15 class VRController final |
16 : public GarbageCollectedFinalized<VRController> | 16 : public GarbageCollectedFinalized<VRController> |
17 , public WillBeHeapSupplement<LocalFrame> | 17 , public WillBeHeapSupplement<LocalFrame> |
18 , public LocalFrameLifecycleObserver { | 18 , public LocalFrameLifecycleObserver { |
19 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(VRController); | 19 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(VRController); |
20 WTF_MAKE_NONCOPYABLE(VRController); | 20 WTF_MAKE_NONCOPYABLE(VRController); |
21 public: | 21 public: |
22 virtual ~VRController(); | 22 virtual ~VRController(); |
23 | 23 |
24 void getDevices(WebVRGetDevicesCallback*); | 24 void getDevices(WebVRGetDevicesCallback*); |
25 | 25 |
26 void getSensorState(unsigned index, blink::WebHMDSensorState& into); | 26 void getSensorState(unsigned index, WebHMDSensorState& into); |
27 | 27 |
28 void resetSensor(unsigned index); | 28 void resetSensor(unsigned index); |
29 | 29 |
30 static void provideTo(LocalFrame&, WebVRClient*); | 30 static void provideTo(LocalFrame&, WebVRClient*); |
31 static VRController* from(LocalFrame&); | 31 static VRController* from(LocalFrame&); |
32 static const char* supplementName(); | 32 static const char* supplementName(); |
33 | 33 |
34 DECLARE_VIRTUAL_TRACE(); | 34 DECLARE_VIRTUAL_TRACE(); |
35 | 35 |
36 private: | 36 private: |
37 VRController(LocalFrame&, WebVRClient*); | 37 VRController(LocalFrame&, WebVRClient*); |
38 | 38 |
39 // Inherited from LocalFrameLifecycleObserver. | 39 // Inherited from LocalFrameLifecycleObserver. |
40 virtual void willDetachFrameHost() override; | 40 virtual void willDetachFrameHost() override; |
41 | 41 |
42 WebVRClient* m_client; | 42 WebVRClient* m_client; |
43 }; | 43 }; |
44 | 44 |
45 } // namespace blink | 45 } // namespace blink |
46 | 46 |
47 #endif // VRController_h | 47 #endif // VRController_h |
OLD | NEW |