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

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

Issue 2662213006: Reject requestPresent requests when fullscreen is not enabled. (Closed)
Patch Set: rebase + address comment Created 3 years, 11 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 | « no previous file | third_party/WebKit/Source/modules/vr/VRDisplay.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c29f8405d094d66596dc02b21e17045db4c89ae0..076b64f97ce91586aaa57f9bb66de94042215eba 100644
--- a/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp
+++ b/third_party/WebKit/Source/modules/vr/NavigatorVR.cpp
@@ -9,6 +9,7 @@
#include "core/dom/Document.h"
#include "core/dom/DocumentUserGestureToken.h"
#include "core/dom/ExceptionCode.h"
+#include "core/dom/Fullscreen.h"
#include "core/frame/LocalDOMWindow.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Navigator.h"
@@ -132,7 +133,11 @@ void NavigatorVR::pageVisibilityChanged() {
void NavigatorVR::didAddEventListener(LocalDOMWindow* window,
const AtomicString& eventType) {
- if (eventType == EventTypeNames::vrdisplayactivate) {
+ // TODO(mthiesse): Remove fullscreen requirement for presentation. See
+ // crbug.com/687369
+ if (eventType == EventTypeNames::vrdisplayactivate &&
+ supplementable()->frame() && supplementable()->frame()->document() &&
+ Fullscreen::fullscreenEnabled(*supplementable()->frame()->document())) {
controller()->setListeningForActivate(true);
m_listeningForActivate = true;
} else if (eventType == EventTypeNames::vrdisplayconnect) {
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/vr/VRDisplay.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698