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

Unified Diff: third_party/WebKit/Source/modules/vr/NavigatorVR.cpp

Issue 2505493004: Wired up vrdisplayactivate/deactivate (Closed)
Patch Set: Again with the upstream issues 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/vr/NavigatorVR.cpp
diff --git a/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp b/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp
index 838a27e93314c025b29e40ce6fed97bb7e0f47e2..a157e2c3d1b13e5066d01f441854b29eacde782c 100644
--- a/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp
+++ b/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp
@@ -7,6 +7,7 @@
#include "bindings/core/v8/ScriptPromiseResolver.h"
#include "core/dom/DOMException.h"
#include "core/dom/Document.h"
+#include "core/dom/DocumentUserGestureToken.h"
#include "core/dom/ExceptionCode.h"
#include "core/frame/LocalDOMWindow.h"
#include "core/frame/LocalFrame.h"
@@ -17,6 +18,7 @@
#include "modules/vr/VRDisplay.h"
#include "modules/vr/VRGetDevicesCallback.h"
#include "modules/vr/VRPose.h"
+#include "platform/UserGestureIndicator.h"
#include "public/platform/Platform.h"
#include "wtf/PtrUtil.h"
@@ -100,26 +102,18 @@ const char* NavigatorVR::supplementName() {
return "NavigatorVR";
}
-void NavigatorVR::fireVRDisplayPresentChange(VRDisplay* display) {
+void NavigatorVR::enqueueVREvent(VRDisplayEvent* event) {
if (frame() && frame()->localDOMWindow()) {
- frame()->localDOMWindow()->enqueueWindowEvent(VRDisplayEvent::create(
- EventTypeNames::vrdisplaypresentchange, true, false, display, ""));
+ frame()->localDOMWindow()->enqueueWindowEvent(event);
}
}
-void NavigatorVR::fireVrDisplayOnBlur(VRDisplay* display) {
- fireVREvent(VRDisplayEvent::create(EventTypeNames::vrdisplayblur, true, false,
- display, ""));
-}
-
-void NavigatorVR::fireVrDisplayOnFocus(VRDisplay* display) {
- fireVREvent(VRDisplayEvent::create(EventTypeNames::vrdisplayfocus, true,
- false, display, ""));
-}
-
-void NavigatorVR::fireVREvent(VRDisplayEvent* event) {
+void NavigatorVR::dispatchVRGestureEvent(VRDisplayEvent* event) {
if (frame() && frame()->localDOMWindow()) {
- frame()->localDOMWindow()->enqueueWindowEvent(event);
+ UserGestureIndicator gestureIndicator(
+ DocumentUserGestureToken::create(frame()->document()));
+ event->setTarget(frame()->localDOMWindow());
+ frame()->localDOMWindow()->dispatchEvent(event);
}
}
« no previous file with comments | « third_party/WebKit/Source/modules/vr/NavigatorVR.h ('k') | third_party/WebKit/Source/modules/vr/VRController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698