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

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: Address comments 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698