Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: third_party/WebKit/Source/modules/vr/NavigatorVR.cpp

Issue 2471433002: Implement WebVR presentation pausing for VR Shell Menu Mode (Closed)
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 return "NavigatorVR"; 100 return "NavigatorVR";
101 } 101 }
102 102
103 void NavigatorVR::fireVRDisplayPresentChange(VRDisplay* display) { 103 void NavigatorVR::fireVRDisplayPresentChange(VRDisplay* display) {
104 if (frame() && frame()->localDOMWindow()) { 104 if (frame() && frame()->localDOMWindow()) {
105 frame()->localDOMWindow()->enqueueWindowEvent(VRDisplayEvent::create( 105 frame()->localDOMWindow()->enqueueWindowEvent(VRDisplayEvent::create(
106 EventTypeNames::vrdisplaypresentchange, true, false, display, "")); 106 EventTypeNames::vrdisplaypresentchange, true, false, display, ""));
107 } 107 }
108 } 108 }
109 109
110 void NavigatorVR::fireVrDisplayOnBlur(VRDisplay* display) {
111 fireVREvent(VRDisplayEvent::create(EventTypeNames::vrdisplayblur, true, false,
112 display, ""));
113 }
114
115 void NavigatorVR::fireVrDisplayOnFocus(VRDisplay* display) {
116 fireVREvent(VRDisplayEvent::create(EventTypeNames::vrdisplayfocus, true,
117 false, display, ""));
118 }
119
110 void NavigatorVR::fireVREvent(VRDisplayEvent* event) { 120 void NavigatorVR::fireVREvent(VRDisplayEvent* event) {
111 if (frame() && frame()->localDOMWindow()) { 121 if (frame() && frame()->localDOMWindow()) {
112 frame()->localDOMWindow()->enqueueWindowEvent(event); 122 frame()->localDOMWindow()->enqueueWindowEvent(event);
113 } 123 }
114 } 124 }
115 125
116 } // namespace blink 126 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/vr/NavigatorVR.h ('k') | third_party/WebKit/Source/modules/vr/VRDisplay.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698