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

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

Issue 2754133002: 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 cc8f1038aae5d967f3865cc8b9a1881194dcb3d9..7439d18b3aef63129ca7cf2deda26a3017c7ffe8 100644
--- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
+++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
@@ -6,7 +6,6 @@
#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"
@@ -231,7 +230,8 @@ ScriptPromise VRDisplay::requestPresent(ScriptState* scriptState,
// 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()) {
+ if (firstPresent && !UserGestureIndicator::utilizeUserGesture() &&
+ !m_inDisplayActivate) {
DOMException* exception = DOMException::create(
InvalidStateError, "API can only be initiated by a user gesture.");
resolver->reject(exception);
@@ -380,7 +380,6 @@ ScriptPromise VRDisplay::exitPresent(ScriptState* scriptState) {
void VRDisplay::beginPresent() {
Document* doc = this->document();
- std::unique_ptr<UserGestureIndicator> gestureIndicator;
if (m_capabilities->hasExternalDisplay()) {
forceExitPresent();
DOMException* exception = DOMException::create(
@@ -666,7 +665,8 @@ void VRDisplay::stopPresenting() {
void VRDisplay::OnActivate(device::mojom::blink::VRDisplayEventReason reason) {
if (!m_navigatorVR->isFocused() || m_displayBlurred)
return;
- m_navigatorVR->dispatchVRGestureEvent(VRDisplayEvent::create(
+ AutoReset<bool> activating(&m_inDisplayActivate, true);
+ m_navigatorVR->dispatchVREvent(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