| 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_service_impl.h" | 9 #include "device/vr/vr_service_impl.h" |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 } | 45 } |
| 46 | 46 |
| 47 void VRDisplayImpl::OnActivate(mojom::VRDisplayEventReason reason) { | 47 void VRDisplayImpl::OnActivate(mojom::VRDisplayEventReason reason) { |
| 48 client_->OnActivate(reason); | 48 client_->OnActivate(reason); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void VRDisplayImpl::OnDeactivate(mojom::VRDisplayEventReason reason) { | 51 void VRDisplayImpl::OnDeactivate(mojom::VRDisplayEventReason reason) { |
| 52 client_->OnDeactivate(reason); | 52 client_->OnDeactivate(reason); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void VRDisplayImpl::ResetPose() { | |
| 56 if (!device_->IsAccessAllowed(this)) | |
| 57 return; | |
| 58 | |
| 59 device_->ResetPose(); | |
| 60 } | |
| 61 | |
| 62 void VRDisplayImpl::RequestPresent(bool secure_origin, | 55 void VRDisplayImpl::RequestPresent(bool secure_origin, |
| 63 mojom::VRSubmitFrameClientPtr submit_client, | 56 mojom::VRSubmitFrameClientPtr submit_client, |
| 64 const RequestPresentCallback& callback) { | 57 const RequestPresentCallback& callback) { |
| 65 if (!device_->IsAccessAllowed(this)) { | 58 if (!device_->IsAccessAllowed(this)) { |
| 66 callback.Run(false); | 59 callback.Run(false); |
| 67 return; | 60 return; |
| 68 } | 61 } |
| 69 | 62 |
| 70 device_->RequestPresent( | 63 device_->RequestPresent( |
| 71 std::move(submit_client), | 64 std::move(submit_client), |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 source_height); | 101 source_height); |
| 109 } | 102 } |
| 110 | 103 |
| 111 void VRDisplayImpl::GetVRVSyncProvider(mojom::VRVSyncProviderRequest request) { | 104 void VRDisplayImpl::GetVRVSyncProvider(mojom::VRVSyncProviderRequest request) { |
| 112 if (!device_->IsAccessAllowed(this)) { | 105 if (!device_->IsAccessAllowed(this)) { |
| 113 return; | 106 return; |
| 114 } | 107 } |
| 115 device_->GetVRVSyncProvider(std::move(request)); | 108 device_->GetVRVSyncProvider(std::move(request)); |
| 116 } | 109 } |
| 117 } | 110 } |
| OLD | NEW |