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

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

Issue 2471433002: Implement WebVR presentation pausing for VR Shell Menu Mode (Closed)
Patch Set: Address comments 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..f0f55a536803a2140109c12c7dc3c515f179d809 100644
--- a/device/vr/android/gvr/gvr_device_provider.cc
+++ b/device/vr/android/gvr/gvr_device_provider.cc
@@ -62,6 +62,7 @@ void GvrDeviceProvider::Initialize() {
}
bool GvrDeviceProvider::RequestPresent() {
+ DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
device::GvrDelegateProvider* delegate_provider =
device::GvrDelegateProvider::GetInstance();
if (!delegate_provider)
@@ -95,9 +96,8 @@ void GvrDeviceProvider::ExitPresent() {
void GvrDeviceProvider::OnGvrDelegateReady(GvrDelegate* delegate) {
main_thread_task_runner_->PostTask(
- FROM_HERE,
- base::Bind(&GvrDeviceProvider::GvrDelegateReady, base::Unretained(this),
- base::Unretained(delegate)));
+ FROM_HERE, base::Bind(&GvrDeviceProvider::GvrDelegateReady, this,
+ base::Unretained(delegate)));
}
void GvrDeviceProvider::OnGvrDelegateRemoved() {
@@ -107,6 +107,26 @@ void GvrDeviceProvider::OnGvrDelegateRemoved() {
ExitPresent();
}
+void GvrDeviceProvider::OnDisplayBlur() {
+ if (!main_thread_task_runner_->BelongsToCurrentThread()) {
+ main_thread_task_runner_->PostTask(
+ FROM_HERE, base::Bind(&GvrDeviceProvider::OnDisplayBlur, this));
+ return;
+ }
+ if (client_)
+ client_->OnDisplayBlur(vr_device_.get());
+}
+
+void GvrDeviceProvider::OnDisplayFocus() {
+ if (!main_thread_task_runner_->BelongsToCurrentThread()) {
+ main_thread_task_runner_->PostTask(
+ FROM_HERE, base::Bind(&GvrDeviceProvider::OnDisplayFocus, this));
+ return;
+ }
+ if (client_)
+ client_->OnDisplayFocus(vr_device_.get());
+}
+
void GvrDeviceProvider::GvrDelegateReady(GvrDelegate* delegate) {
DCHECK(main_thread_task_runner_->BelongsToCurrentThread());

Powered by Google App Engine
This is Rietveld 408576698