Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: device/vr/vr_display_impl.cc

Issue 2844833005: Tentatively goes into WebVR presentation mode if page listens to vrdisplayactivate. (Closed)
Patch Set: Fixed device unit tests Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/vr/vr_display_impl.h ('k') | device/vr/vr_service.mojom » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « device/vr/vr_display_impl.h ('k') | device/vr/vr_service.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698