| Index: device/vr/vr_device_manager.cc
|
| diff --git a/device/vr/vr_device_manager.cc b/device/vr/vr_device_manager.cc
|
| index b8c99ea3566c19e288ae011494bb6a1e7add6f04..e92ef5c17443a9fb528484b6a95499bcd92c507c 100644
|
| --- a/device/vr/vr_device_manager.cc
|
| +++ b/device/vr/vr_device_manager.cc
|
| @@ -79,7 +79,7 @@ VRDevice* VRDeviceManager::GetAllowedDevice(VRServiceImpl* service,
|
| void VRDeviceManager::SetInstance(VRDeviceManager* instance) {
|
| // Unit tests can create multiple instances but only one should exist at any
|
| // given time so g_vr_device_manager should only go from nullptr to
|
| - // non-nullptr and vica versa.
|
| + // non-nullptr and vice versa.
|
| CHECK_NE(!!instance, !!g_vr_device_manager);
|
| g_vr_device_manager = instance;
|
| }
|
| @@ -287,6 +287,31 @@ void VRDeviceManager::OnPresentEnded(VRDevice* device) {
|
| presenting_device_ = nullptr;
|
| }
|
|
|
| +void VRDeviceManager::PausePresent(VRDevice* device) {
|
| + // Ensure the presenting device is the one that we've been requested to pause.
|
| + if (!presenting_device_ || presenting_device_ != device)
|
| + return;
|
| +
|
| + // Should never have a presenting device without a presenting service.
|
| + DCHECK(presenting_service_);
|
| +
|
| + // Notify the presenting service that it should pause.
|
| + presenting_service_->client()->OnPausePresent(device->id());
|
| +}
|
| +
|
| +void VRDeviceManager::ResumePresent(VRDevice* device) {
|
| + // Ensure the presenting device is the one that we've been requested to
|
| + // resume.
|
| + if (!presenting_device_ || presenting_device_ != device)
|
| + return;
|
| +
|
| + // Should never have a presenting device without a presenting service.
|
| + DCHECK(presenting_service_);
|
| +
|
| + // Notify the presenting service that it should pause.
|
| + presenting_service_->client()->OnResumePresent(device->id());
|
| +}
|
| +
|
| void VRDeviceManager::InitializeProviders() {
|
| if (vr_initialized_) {
|
| return;
|
|
|