| 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); | 37 void requestPresent(ScriptPromiseResolver*, unsigned index); |
| 38 void exitPresent(unsigned index); | 38 void exitPresent(unsigned index); |
| 39 void submitFrame(unsigned index); | 39 void submitFrame(unsigned index, device::blink::VRPosePtr); |
| 40 void updateLayerBounds(unsigned index, | 40 void updateLayerBounds(unsigned index, |
| 41 device::blink::VRLayerBoundsPtr leftBounds, | 41 device::blink::VRLayerBoundsPtr leftBounds, |
| 42 device::blink::VRLayerBoundsPtr rightBounds); | 42 device::blink::VRLayerBoundsPtr rightBounds); |
| 43 | 43 |
| 44 VRDisplay* createOrUpdateDisplay(const device::blink::VRDisplayPtr&); | 44 VRDisplay* createOrUpdateDisplay(const device::blink::VRDisplayPtr&); |
| 45 VRDisplayVector updateDisplays(mojo::WTFArray<device::blink::VRDisplayPtr>); | 45 VRDisplayVector updateDisplays(mojo::WTFArray<device::blink::VRDisplayPtr>); |
| 46 VRDisplay* getDisplayForIndex(unsigned index); | 46 VRDisplay* getDisplayForIndex(unsigned index); |
| 47 | 47 |
| 48 DECLARE_VIRTUAL_TRACE(); | 48 DECLARE_VIRTUAL_TRACE(); |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 // Binding callbacks. | 51 // Binding callbacks. |
| 52 void onGetDisplays(mojo::WTFArray<device::blink::VRDisplayPtr>); | 52 void onGetDisplays(mojo::WTFArray<device::blink::VRDisplayPtr>); |
| 53 void onPresentComplete(ScriptPromiseResolver*, unsigned index, bool success)
; |
| 53 | 54 |
| 54 // VRServiceClient. | 55 // VRServiceClient. |
| 55 void OnDisplayChanged(device::blink::VRDisplayPtr) override; | 56 void OnDisplayChanged(device::blink::VRDisplayPtr) override; |
| 57 void OnExitPresent(unsigned index) override; |
| 56 | 58 |
| 57 // ContextLifecycleObserver. | 59 // ContextLifecycleObserver. |
| 58 void contextDestroyed() override; | 60 void contextDestroyed() override; |
| 59 | 61 |
| 60 Member<NavigatorVR> m_navigatorVR; | 62 Member<NavigatorVR> m_navigatorVR; |
| 61 VRDisplayVector m_displays; | 63 VRDisplayVector m_displays; |
| 62 | 64 |
| 63 Deque<std::unique_ptr<VRGetDevicesCallback>> m_pendingGetDevicesCallbacks; | 65 Deque<std::unique_ptr<VRGetDevicesCallback>> m_pendingGetDevicesCallbacks; |
| 64 device::blink::VRServicePtr m_service; | 66 device::blink::VRServicePtr m_service; |
| 65 mojo::Binding<device::blink::VRServiceClient> m_binding; | 67 mojo::Binding<device::blink::VRServiceClient> m_binding; |
| 66 }; | 68 }; |
| 67 | 69 |
| 68 } // namespace blink | 70 } // namespace blink |
| 69 | 71 |
| 70 #endif // VRController_h | 72 #endif // VRController_h |
| OLD | NEW |