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

Unified Diff: third_party/WebKit/Source/modules/vr/VRDisplay.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/vr/VRDisplay.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/vr/VRDisplay.cpp
diff --git a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
index 7439d18b3aef63129ca7cf2deda26a3017c7ffe8..cc8f1038aae5d967f3865cc8b9a1881194dcb3d9 100644
--- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
+++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
@@ -6,6 +6,7 @@
#include "core/css/StylePropertySet.h"
#include "core/dom/DOMException.h"
+#include "core/dom/DocumentUserGestureToken.h"
#include "core/dom/FrameRequestCallback.h"
#include "core/dom/Fullscreen.h"
#include "core/dom/ScriptedAnimationController.h"
@@ -230,8 +231,7 @@
// If the VRDisplay is already presenting, however, repeated calls are
// allowed outside a user gesture so that the presented content may be
// updated.
- if (firstPresent && !UserGestureIndicator::utilizeUserGesture() &&
- !m_inDisplayActivate) {
+ if (firstPresent && !UserGestureIndicator::utilizeUserGesture()) {
DOMException* exception = DOMException::create(
InvalidStateError, "API can only be initiated by a user gesture.");
resolver->reject(exception);
@@ -380,6 +380,7 @@
void VRDisplay::beginPresent() {
Document* doc = this->document();
+ std::unique_ptr<UserGestureIndicator> gestureIndicator;
if (m_capabilities->hasExternalDisplay()) {
forceExitPresent();
DOMException* exception = DOMException::create(
@@ -665,8 +666,7 @@
void VRDisplay::OnActivate(device::mojom::blink::VRDisplayEventReason reason) {
if (!m_navigatorVR->isFocused() || m_displayBlurred)
return;
- AutoReset<bool> activating(&m_inDisplayActivate, true);
- m_navigatorVR->dispatchVREvent(VRDisplayEvent::create(
+ m_navigatorVR->dispatchVRGestureEvent(VRDisplayEvent::create(
EventTypeNames::vrdisplayactivate, true, false, this, reason));
}
« no previous file with comments | « third_party/WebKit/Source/modules/vr/VRDisplay.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698