| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 return "NavigatorVR"; | 97 return "NavigatorVR"; |
| 98 } | 98 } |
| 99 | 99 |
| 100 void NavigatorVR::fireVRDisplayPresentChange(VRDisplay* display) { | 100 void NavigatorVR::fireVRDisplayPresentChange(VRDisplay* display) { |
| 101 if (frame() && frame()->localDOMWindow()) { | 101 if (frame() && frame()->localDOMWindow()) { |
| 102 frame()->localDOMWindow()->enqueueWindowEvent(VRDisplayEvent::create( | 102 frame()->localDOMWindow()->enqueueWindowEvent(VRDisplayEvent::create( |
| 103 EventTypeNames::vrdisplaypresentchange, true, false, display, "")); | 103 EventTypeNames::vrdisplaypresentchange, true, false, display, "")); |
| 104 } | 104 } |
| 105 } | 105 } |
| 106 | 106 |
| 107 void NavigatorVR::fireVrDisplayOnBlur(VRDisplay* display) { |
| 108 fireVREvent(VRDisplayEvent::create(EventTypeNames::vrdisplayblur, true, false, |
| 109 display, "")); |
| 110 } |
| 111 |
| 112 void NavigatorVR::fireVrDisplayOnFocus(VRDisplay* display) { |
| 113 fireVREvent(VRDisplayEvent::create(EventTypeNames::vrdisplayfocus, true, |
| 114 false, display, "")); |
| 115 } |
| 116 |
| 107 void NavigatorVR::fireVREvent(VRDisplayEvent* event) { | 117 void NavigatorVR::fireVREvent(VRDisplayEvent* event) { |
| 108 if (frame() && frame()->localDOMWindow()) { | 118 if (frame() && frame()->localDOMWindow()) { |
| 109 frame()->localDOMWindow()->enqueueWindowEvent(event); | 119 frame()->localDOMWindow()->enqueueWindowEvent(event); |
| 110 } | 120 } |
| 111 } | 121 } |
| 112 | 122 |
| 113 } // namespace blink | 123 } // namespace blink |
| OLD | NEW |