| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "device/vr/vr_device.h" | 8 #include "device/vr/vr_device.h" |
| 9 #include "device/vr/vr_device_manager.h" | 9 #include "device/vr/vr_device_manager.h" |
| 10 #include "device/vr/vr_service_impl.h" | 10 #include "device/vr/vr_service_impl.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 VRDeviceManager* manager = VRDeviceManager::GetInstance(); | 49 VRDeviceManager* manager = VRDeviceManager::GetInstance(); |
| 50 if (!manager->IsMostRecentlyListeningForActivate(service_)) | 50 if (!manager->IsMostRecentlyListeningForActivate(service_)) |
| 51 return; | 51 return; |
| 52 client_->OnActivate(reason); | 52 client_->OnActivate(reason); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void VRDisplayImpl::OnDeactivate(mojom::VRDisplayEventReason reason) { | 55 void VRDisplayImpl::OnDeactivate(mojom::VRDisplayEventReason reason) { |
| 56 client_->OnDeactivate(reason); | 56 client_->OnDeactivate(reason); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void VRDisplayImpl::ResetPose() { | |
| 60 if (!device_->IsAccessAllowed(this)) | |
| 61 return; | |
| 62 | |
| 63 device_->ResetPose(); | |
| 64 } | |
| 65 | |
| 66 void VRDisplayImpl::RequestPresent(bool secure_origin, | 59 void VRDisplayImpl::RequestPresent(bool secure_origin, |
| 67 mojom::VRSubmitFrameClientPtr submit_client, | 60 mojom::VRSubmitFrameClientPtr submit_client, |
| 68 const RequestPresentCallback& callback) { | 61 const RequestPresentCallback& callback) { |
| 69 if (!device_->IsAccessAllowed(this)) { | 62 if (!device_->IsAccessAllowed(this)) { |
| 70 callback.Run(false); | 63 callback.Run(false); |
| 71 return; | 64 return; |
| 72 } | 65 } |
| 73 | 66 |
| 74 device_->RequestPresent( | 67 device_->RequestPresent( |
| 75 std::move(submit_client), | 68 std::move(submit_client), |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 source_height); | 105 source_height); |
| 113 } | 106 } |
| 114 | 107 |
| 115 void VRDisplayImpl::GetVRVSyncProvider(mojom::VRVSyncProviderRequest request) { | 108 void VRDisplayImpl::GetVRVSyncProvider(mojom::VRVSyncProviderRequest request) { |
| 116 if (!device_->IsAccessAllowed(this)) { | 109 if (!device_->IsAccessAllowed(this)) { |
| 117 return; | 110 return; |
| 118 } | 111 } |
| 119 device_->GetVRVSyncProvider(std::move(request)); | 112 device_->GetVRVSyncProvider(std::move(request)); |
| 120 } | 113 } |
| 121 } | 114 } |
| OLD | NEW |