| 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 #include "modules/vr/VRController.h" | 5 #include "modules/vr/VRController.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptPromiseResolver.h" | 7 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 8 #include "core/dom/DOMException.h" | 8 #include "core/dom/DOMException.h" |
| 9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // Each time a new VRDisplay is connected we'll recieve a VRDisplayPtr for it | 55 // Each time a new VRDisplay is connected we'll recieve a VRDisplayPtr for it |
| 56 // here. Upon calling SetClient in the constructor we should receive one call | 56 // here. Upon calling SetClient in the constructor we should receive one call |
| 57 // for each VRDisplay that was already connected at the time. | 57 // for each VRDisplay that was already connected at the time. |
| 58 void VRController::OnDisplayConnected( | 58 void VRController::OnDisplayConnected( |
| 59 device::mojom::blink::VRDisplayPtr display, | 59 device::mojom::blink::VRDisplayPtr display, |
| 60 device::mojom::blink::VRDisplayClientRequest request, | 60 device::mojom::blink::VRDisplayClientRequest request, |
| 61 device::mojom::blink::VRDisplayInfoPtr displayInfo) { | 61 device::mojom::blink::VRDisplayInfoPtr displayInfo) { |
| 62 VRDisplay* vrDisplay = | 62 VRDisplay* vrDisplay = |
| 63 new VRDisplay(m_navigatorVR, std::move(display), std::move(request)); | 63 new VRDisplay(m_navigatorVR, std::move(display), std::move(request)); |
| 64 vrDisplay->update(displayInfo); | 64 vrDisplay->update(displayInfo); |
| 65 vrDisplay->onDisplayConnected(); | 65 vrDisplay->onConnected(); |
| 66 m_displays.append(vrDisplay); | 66 m_displays.append(vrDisplay); |
| 67 | 67 |
| 68 if (m_displays.size() == m_numberOfSyncedDisplays) { | 68 if (m_displays.size() == m_numberOfSyncedDisplays) { |
| 69 m_displaySynced = true; | 69 m_displaySynced = true; |
| 70 onGetDisplays(); | 70 onGetDisplays(); |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| 74 // Called when the VRService has called OnDisplayConnected for all active | 74 // Called when the VRService has called OnDisplayConnected for all active |
| 75 // VRDisplays. | 75 // VRDisplays. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } | 107 } |
| 108 | 108 |
| 109 DEFINE_TRACE(VRController) { | 109 DEFINE_TRACE(VRController) { |
| 110 visitor->trace(m_navigatorVR); | 110 visitor->trace(m_navigatorVR); |
| 111 visitor->trace(m_displays); | 111 visitor->trace(m_displays); |
| 112 | 112 |
| 113 ContextLifecycleObserver::trace(visitor); | 113 ContextLifecycleObserver::trace(visitor); |
| 114 } | 114 } |
| 115 | 115 |
| 116 } // namespace blink | 116 } // namespace blink |
| OLD | NEW |