| 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/dom/ContextLifecycleObserver.h" | 8 #include "core/dom/ContextLifecycleObserver.h" |
| 9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
| 10 #include "device/vr/vr_service.mojom-blink.h" | 10 #include "device/vr/vr_service.mojom-blink.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 USING_GARBAGE_COLLECTED_MIXIN(VRController); | 27 USING_GARBAGE_COLLECTED_MIXIN(VRController); |
| 28 WTF_MAKE_NONCOPYABLE(VRController); | 28 WTF_MAKE_NONCOPYABLE(VRController); |
| 29 public: | 29 public: |
| 30 VRController(NavigatorVR*); | 30 VRController(NavigatorVR*); |
| 31 virtual ~VRController(); | 31 virtual ~VRController(); |
| 32 | 32 |
| 33 // VRService. | 33 // VRService. |
| 34 void getDisplays(ScriptPromiseResolver*); | 34 void getDisplays(ScriptPromiseResolver*); |
| 35 device::blink::VRPosePtr getPose(unsigned index); | 35 device::blink::VRPosePtr getPose(unsigned index); |
| 36 void resetPose(unsigned index); | 36 void resetPose(unsigned index); |
| 37 void requestPresent(unsigned index); |
| 38 void exitPresent(unsigned index); |
| 39 void submitFrame(unsigned index); |
| 40 void updateLayerBounds(unsigned index, |
| 41 device::blink::VRLayerBoundsPtr leftBounds, |
| 42 device::blink::VRLayerBoundsPtr rightBounds); |
| 37 | 43 |
| 38 VRDisplay* createOrUpdateDisplay(const device::blink::VRDisplayPtr&); | 44 VRDisplay* createOrUpdateDisplay(const device::blink::VRDisplayPtr&); |
| 39 VRDisplayVector updateDisplays(mojo::WTFArray<device::blink::VRDisplayPtr>); | 45 VRDisplayVector updateDisplays(mojo::WTFArray<device::blink::VRDisplayPtr>); |
| 40 VRDisplay* getDisplayForIndex(unsigned index); | 46 VRDisplay* getDisplayForIndex(unsigned index); |
| 41 | 47 |
| 42 DECLARE_VIRTUAL_TRACE(); | 48 DECLARE_VIRTUAL_TRACE(); |
| 43 | 49 |
| 44 private: | 50 private: |
| 45 // Binding callbacks. | 51 // Binding callbacks. |
| 46 void onGetDisplays(mojo::WTFArray<device::blink::VRDisplayPtr>); | 52 void onGetDisplays(mojo::WTFArray<device::blink::VRDisplayPtr>); |
| 47 | 53 |
| 48 // VRServiceClient. | 54 // VRServiceClient. |
| 49 void OnDisplayChanged(device::blink::VRDisplayPtr) override; | 55 void OnDisplayChanged(device::blink::VRDisplayPtr) override; |
| 50 | 56 |
| 51 // ContextLifecycleObserver. | 57 // ContextLifecycleObserver. |
| 52 void contextDestroyed() override; | 58 void contextDestroyed() override; |
| 53 | 59 |
| 54 Member<NavigatorVR> m_navigatorVR; | 60 Member<NavigatorVR> m_navigatorVR; |
| 55 VRDisplayVector m_displays; | 61 VRDisplayVector m_displays; |
| 56 | 62 |
| 57 Deque<std::unique_ptr<VRGetDevicesCallback>> m_pendingGetDevicesCallbacks; | 63 Deque<std::unique_ptr<VRGetDevicesCallback>> m_pendingGetDevicesCallbacks; |
| 58 device::blink::VRServicePtr m_service; | 64 device::blink::VRServicePtr m_service; |
| 59 mojo::Binding<device::blink::VRServiceClient> m_binding; | 65 mojo::Binding<device::blink::VRServiceClient> m_binding; |
| 60 }; | 66 }; |
| 61 | 67 |
| 62 } // namespace blink | 68 } // namespace blink |
| 63 | 69 |
| 64 #endif // VRController_h | 70 #endif // VRController_h |
| OLD | NEW |