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 27 matching lines...) Expand all Loading... |
38 } | 38 } |
39 | 39 |
40 void VRDisplayImpl::OnBlur() { | 40 void VRDisplayImpl::OnBlur() { |
41 client_->OnBlur(); | 41 client_->OnBlur(); |
42 } | 42 } |
43 | 43 |
44 void VRDisplayImpl::OnFocus() { | 44 void VRDisplayImpl::OnFocus() { |
45 client_->OnFocus(); | 45 client_->OnFocus(); |
46 } | 46 } |
47 | 47 |
48 void VRDisplayImpl::OnActivate(mojom::VRDisplayEventReason reason) { | 48 void VRDisplayImpl::OnActivate(mojom::VRDisplayEventReason reason, |
| 49 const base::Callback<void(bool)>& on_handled) { |
49 VRDeviceManager* manager = VRDeviceManager::GetInstance(); | 50 VRDeviceManager* manager = VRDeviceManager::GetInstance(); |
50 if (!manager->IsMostRecentlyListeningForActivate(service_)) | 51 if (!manager->IsMostRecentlyListeningForActivate(service_)) |
51 return; | 52 return; |
52 client_->OnActivate(reason); | 53 client_->OnActivate(reason, on_handled); |
53 } | 54 } |
54 | 55 |
55 void VRDisplayImpl::OnDeactivate(mojom::VRDisplayEventReason reason) { | 56 void VRDisplayImpl::OnDeactivate(mojom::VRDisplayEventReason reason) { |
56 client_->OnDeactivate(reason); | 57 client_->OnDeactivate(reason); |
57 } | 58 } |
58 | 59 |
59 void VRDisplayImpl::RequestPresent(bool secure_origin, | 60 void VRDisplayImpl::RequestPresent(bool secure_origin, |
60 mojom::VRSubmitFrameClientPtr submit_client, | 61 mojom::VRSubmitFrameClientPtr submit_client, |
61 const RequestPresentCallback& callback) { | 62 const RequestPresentCallback& callback) { |
62 // TODO(mthiesse): Re-enable insecure origin support once webVR content | 63 // TODO(mthiesse): Re-enable insecure origin support once webVR content |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 source_height); | 108 source_height); |
108 } | 109 } |
109 | 110 |
110 void VRDisplayImpl::GetVRVSyncProvider(mojom::VRVSyncProviderRequest request) { | 111 void VRDisplayImpl::GetVRVSyncProvider(mojom::VRVSyncProviderRequest request) { |
111 if (!device_->IsAccessAllowed(this)) { | 112 if (!device_->IsAccessAllowed(this)) { |
112 return; | 113 return; |
113 } | 114 } |
114 device_->GetVRVSyncProvider(std::move(request)); | 115 device_->GetVRVSyncProvider(std::move(request)); |
115 } | 116 } |
116 } | 117 } |
OLD | NEW |