| 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/NavigatorVR.h" | 5 #include "modules/vr/NavigatorVR.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/dom/ExceptionCode.h" | 10 #include "core/dom/ExceptionCode.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 ScriptPromise promise = resolver->promise(); | 50 ScriptPromise promise = resolver->promise(); |
| 51 | 51 |
| 52 Document* document = m_frame ? m_frame->document() : 0; | 52 Document* document = m_frame ? m_frame->document() : 0; |
| 53 | 53 |
| 54 if (!document || !controller()) { | 54 if (!document || !controller()) { |
| 55 DOMException* exception = DOMException::create(InvalidStateError, "The o
bject is no longer associated to a document."); | 55 DOMException* exception = DOMException::create(InvalidStateError, "The o
bject is no longer associated to a document."); |
| 56 resolver->reject(exception); | 56 resolver->reject(exception); |
| 57 return promise; | 57 return promise; |
| 58 } | 58 } |
| 59 | 59 |
| 60 controller()->getDevices(WTF::wrapUnique(new VRGetDevicesCallback(resolver,
m_displays.get()))); | 60 controller()->getDisplays(WTF::wrapUnique(new VRGetDevicesCallback(resolver,
m_displays.get()))); |
| 61 | 61 |
| 62 return promise; | 62 return promise; |
| 63 } | 63 } |
| 64 | 64 |
| 65 VRController* NavigatorVR::controller() | 65 VRController* NavigatorVR::controller() |
| 66 { | 66 { |
| 67 if (!frame()) | 67 if (!frame()) |
| 68 return 0; | 68 return 0; |
| 69 | 69 |
| 70 return VRController::from(*frame()); | 70 return VRController::from(*frame()); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 92 NavigatorVR::~NavigatorVR() | 92 NavigatorVR::~NavigatorVR() |
| 93 { | 93 { |
| 94 } | 94 } |
| 95 | 95 |
| 96 const char* NavigatorVR::supplementName() | 96 const char* NavigatorVR::supplementName() |
| 97 { | 97 { |
| 98 return "NavigatorVR"; | 98 return "NavigatorVR"; |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace blink | 101 } // namespace blink |
| OLD | NEW |