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

Unified Diff: device/vr/android/gvr/gvr_device_provider.cc

Issue 2471433002: Implement WebVR presentation pausing for VR Shell Menu Mode (Closed)
Patch Set: Created 4 years, 1 month 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
Index: device/vr/android/gvr/gvr_device_provider.cc
diff --git a/device/vr/android/gvr/gvr_device_provider.cc b/device/vr/android/gvr/gvr_device_provider.cc
index 252aa117667e09cce9ca7041c791706dc8c2a220..6378faf3ad8b3fe3ce8f7e24313d016cba63c269 100644
--- a/device/vr/android/gvr/gvr_device_provider.cc
+++ b/device/vr/android/gvr/gvr_device_provider.cc
@@ -107,6 +107,28 @@ void GvrDeviceProvider::OnGvrDelegateRemoved() {
ExitPresent();
}
+void GvrDeviceProvider::PausePresent() {
+ if (!main_thread_task_runner_->BelongsToCurrentThread()) {
+ main_thread_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&GvrDeviceProvider::PausePresent, base::Unretained(this)));
+ return;
+ }
+ if (client_)
+ client_->PausePresent(vr_device_.get());
+}
+
+void GvrDeviceProvider::ResumePresent() {
+ if (!main_thread_task_runner_->BelongsToCurrentThread()) {
+ main_thread_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(&GvrDeviceProvider::ResumePresent, base::Unretained(this)));
+ return;
+ }
+ if (client_)
+ client_->ResumePresent(vr_device_.get());
+}
+
void GvrDeviceProvider::GvrDelegateReady(GvrDelegate* delegate) {
DCHECK(main_thread_task_runner_->BelongsToCurrentThread());

Powered by Google App Engine
This is Rietveld 408576698