| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 // If we've previously synced the VRDisplays just return the current list. | 43 // If we've previously synced the VRDisplays just return the current list. |
| 44 if (m_displaySynced) { | 44 if (m_displaySynced) { |
| 45 resolver->resolve(m_displays); | 45 resolver->resolve(m_displays); |
| 46 return; | 46 return; |
| 47 } | 47 } |
| 48 | 48 |
| 49 // Otherwise we're still waiting for the full list of displays to be populated | 49 // Otherwise we're still waiting for the full list of displays to be populated |
| 50 // so queue up the promise for resolution when onDisplaysSynced is called. | 50 // so queue up the promise for resolution when onDisplaysSynced is called. |
| 51 m_pendingGetDevicesCallbacks.append( | 51 m_pendingGetDevicesCallbacks.append( |
| 52 makeUnique<VRGetDevicesCallback>(resolver)); | 52 WTF::makeUnique<VRGetDevicesCallback>(resolver)); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void VRController::setListeningForActivate(bool listening) { | 55 void VRController::setListeningForActivate(bool listening) { |
| 56 if (m_service) | 56 if (m_service) |
| 57 m_service->SetListeningForActivate(listening); | 57 m_service->SetListeningForActivate(listening); |
| 58 } | 58 } |
| 59 | 59 |
| 60 // Each time a new VRDisplay is connected we'll recieve a VRDisplayPtr for it | 60 // Each time a new VRDisplay is connected we'll recieve a VRDisplayPtr for it |
| 61 // here. Upon calling SetClient in the constructor we should receive one call | 61 // here. Upon calling SetClient in the constructor we should receive one call |
| 62 // for each VRDisplay that was already connected at the time. | 62 // for each VRDisplay that was already connected at the time. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 } | 112 } |
| 113 | 113 |
| 114 DEFINE_TRACE(VRController) { | 114 DEFINE_TRACE(VRController) { |
| 115 visitor->trace(m_navigatorVR); | 115 visitor->trace(m_navigatorVR); |
| 116 visitor->trace(m_displays); | 116 visitor->trace(m_displays); |
| 117 | 117 |
| 118 ContextLifecycleObserver::trace(visitor); | 118 ContextLifecycleObserver::trace(visitor); |
| 119 } | 119 } |
| 120 | 120 |
| 121 } // namespace blink | 121 } // namespace blink |
| OLD | NEW |