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

Unified Diff: third_party/WebKit/Source/modules/vr/VRDisplay.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 | « 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 6be80f1bcecd136bd0999d7529f72a73ab27f619..4810e4fa6c24817abeabd72c20f1899c1dfaa14f 100644
--- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
+++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
@@ -238,6 +238,17 @@ ScriptPromise VRDisplay::requestPresent(ScriptState* scriptState,
return promise;
}
+ // TODO(mthiesse): Remove fullscreen requirement for presentation. See
+ // crbug.com/687369
+ Document* doc = this->document();
+ if (!doc || !Fullscreen::fullscreenEnabled(*doc)) {
+ DOMException* exception =
+ DOMException::create(InvalidStateError, "Fullscreen is not enabled.");
+ resolver->reject(exception);
+ ReportPresentationResult(PresentationResult::FullscreenNotEnabled);
+ return promise;
+ }
+
// A valid number of layers must be provided in order to present.
if (layers.size() == 0 || layers.size() > m_capabilities->maxLayers()) {
forceExitPresent();
« 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