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

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

Issue 2844833005: Tentatively goes into WebVR presentation mode if page listens to vrdisplayactivate. (Closed)
Patch Set: Fixed device unit tests Created 3 years, 8 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 553622a0dfa064f16522cfd8694dc7834f1abb48..1c8baa8e33f1f4f2879fee6898498cddea9fff7f 100644
--- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
+++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
@@ -295,6 +295,7 @@ ScriptPromise VRDisplay::requestPresent(ScriptState* script_state,
submit_frame_client_binding_.CreateInterfacePtrAndBind(),
ConvertToBaseCallback(
WTF::Bind(&VRDisplay::OnPresentComplete, WrapPersistent(this))));
+ pending_present_request_ = true;
} else {
UpdateLayerBounds();
resolver->Resolve();
@@ -305,6 +306,7 @@ ScriptPromise VRDisplay::requestPresent(ScriptState* script_state,
}
void VRDisplay::OnPresentComplete(bool success) {
+ pending_present_request_ = false;
if (success) {
this->BeginPresent();
} else {
@@ -661,10 +663,12 @@ void VRDisplay::StopPresenting() {
pending_previous_frame_render_ = false;
}
-void VRDisplay::OnActivate(device::mojom::blink::VRDisplayEventReason reason) {
+void VRDisplay::OnActivate(device::mojom::blink::VRDisplayEventReason reason,
+ const OnActivateCallback& on_handled) {
AutoReset<bool> activating(&in_display_activate_, true);
navigator_vr_->DispatchVREvent(VRDisplayEvent::Create(
EventTypeNames::vrdisplayactivate, true, false, this, reason));
+ on_handled.Run(pending_present_request_);
}
void VRDisplay::OnDeactivate(
« 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