Chromium Code Reviews| 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..a24a68c1629b9946ec36f5f2db20701d17b95ab2 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::OnDisplayBlur() { |
| + if (!main_thread_task_runner_->BelongsToCurrentThread()) { |
| + main_thread_task_runner_->PostTask( |
| + FROM_HERE, |
| + base::Bind(&GvrDeviceProvider::OnDisplayBlur, base::Unretained(this))); |
|
dcheng
2016/11/04 05:24:46
Can you explain why this used of Unretained() is s
mthiesse
2016/11/04 17:20:36
As Brandon wrote this class and I was really just
|
| + 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, base::Unretained(this))); |
| + return; |
| + } |
| + if (client_) |
| + client_->OnDisplayFocus(vr_device_.get()); |
| +} |
| + |
| void GvrDeviceProvider::GvrDelegateReady(GvrDelegate* delegate) { |
| DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); |