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

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

Issue 2751753003: 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 4fa6fa737b48b1bcd283427ec31cc2e29c010de0..af69d50d965eee910cef3b2946045fb1b523ca57 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/ScriptedAnimationController.h"
#include "core/dom/TaskRunnerHelper.h"
@@ -228,7 +227,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);
@@ -369,7 +369,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(
@@ -679,7 +678,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