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

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

Issue 2756033002: Revert of Remove gesture token from vrdisplayactivate (Closed)
Patch Set: Created 3 years, 9 months 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/DocumentUserGestureToken.h"
10 #include "core/dom/ExceptionCode.h" 11 #include "core/dom/ExceptionCode.h"
11 #include "core/dom/Fullscreen.h" 12 #include "core/dom/Fullscreen.h"
12 #include "core/frame/LocalDOMWindow.h" 13 #include "core/frame/LocalDOMWindow.h"
13 #include "core/frame/LocalFrame.h" 14 #include "core/frame/LocalFrame.h"
14 #include "core/frame/Navigator.h" 15 #include "core/frame/Navigator.h"
15 #include "core/frame/UseCounter.h" 16 #include "core/frame/UseCounter.h"
16 #include "core/page/Page.h" 17 #include "core/page/Page.h"
17 #include "modules/vr/VRController.h" 18 #include "modules/vr/VRController.h"
18 #include "modules/vr/VRDisplay.h" 19 #include "modules/vr/VRDisplay.h"
19 #include "modules/vr/VRGetDevicesCallback.h" 20 #include "modules/vr/VRGetDevicesCallback.h"
20 #include "modules/vr/VRPose.h" 21 #include "modules/vr/VRPose.h"
22 #include "platform/UserGestureIndicator.h"
21 #include "public/platform/Platform.h" 23 #include "public/platform/Platform.h"
22 #include "wtf/PtrUtil.h" 24 #include "wtf/PtrUtil.h"
23 25
24 namespace blink { 26 namespace blink {
25 27
26 namespace { 28 namespace {
27 29
28 void rejectNavigatorDetached(ScriptPromiseResolver* resolver) { 30 void rejectNavigatorDetached(ScriptPromiseResolver* resolver) {
29 DOMException* exception = DOMException::create( 31 DOMException* exception = DOMException::create(
30 InvalidStateError, "The object is no longer associated with a document."); 32 InvalidStateError, "The object is no longer associated with a document.");
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 return "NavigatorVR"; 124 return "NavigatorVR";
123 } 125 }
124 126
125 void NavigatorVR::enqueueVREvent(VRDisplayEvent* event) { 127 void NavigatorVR::enqueueVREvent(VRDisplayEvent* event) {
126 if (!supplementable()->frame()) 128 if (!supplementable()->frame())
127 return; 129 return;
128 130
129 supplementable()->frame()->domWindow()->enqueueWindowEvent(event); 131 supplementable()->frame()->domWindow()->enqueueWindowEvent(event);
130 } 132 }
131 133
132 void NavigatorVR::dispatchVREvent(VRDisplayEvent* event) { 134 void NavigatorVR::dispatchVRGestureEvent(VRDisplayEvent* event) {
133 if (!(supplementable()->frame())) 135 if (!(supplementable()->frame()))
134 return; 136 return;
135 137
138 UserGestureIndicator gestureIndicator(
139 DocumentUserGestureToken::create(document()));
136 LocalDOMWindow* window = supplementable()->frame()->domWindow(); 140 LocalDOMWindow* window = supplementable()->frame()->domWindow();
137 DCHECK(window); 141 DCHECK(window);
138 event->setTarget(window); 142 event->setTarget(window);
139 window->dispatchEvent(event); 143 window->dispatchEvent(event);
140 } 144 }
141 145
142 void NavigatorVR::focusedFrameChanged() { 146 void NavigatorVR::focusedFrameChanged() {
143 bool focused = isFrameFocused(supplementable()->frame()); 147 bool focused = isFrameFocused(supplementable()->frame());
144 if (focused == m_focused) 148 if (focused == m_focused)
145 return; 149 return;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 181
178 void NavigatorVR::didRemoveAllEventListeners(LocalDOMWindow* window) { 182 void NavigatorVR::didRemoveAllEventListeners(LocalDOMWindow* window) {
179 if (!m_controller) 183 if (!m_controller)
180 return; 184 return;
181 185
182 m_controller->setListeningForActivate(false); 186 m_controller->setListeningForActivate(false);
183 m_listeningForActivate = false; 187 m_listeningForActivate = false;
184 } 188 }
185 189
186 } // namespace blink 190 } // 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