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

Side by Side Diff: device/vr/android/gvr/gvr_device_provider.cc

Issue 2624633002: Remove Sync GetPose VRService call, implement VRVSyncProvider (Closed)
Patch Set: Created 3 years, 11 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
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 "device/vr/android/gvr/gvr_device_provider.h" 5 #include "device/vr/android/gvr/gvr_device_provider.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 8
9 #include "base/android/context_utils.h" 9 #include "base/android/context_utils.h"
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 return; 114 return;
115 vr_device_->OnFocus(); 115 vr_device_->OnFocus();
116 } 116 }
117 117
118 void GvrDeviceProvider::OnDisplayActivate() { 118 void GvrDeviceProvider::OnDisplayActivate() {
119 if (!vr_device_) 119 if (!vr_device_)
120 return; 120 return;
121 vr_device_->OnActivate(mojom::VRDisplayEventReason::MOUNTED); 121 vr_device_->OnActivate(mojom::VRDisplayEventReason::MOUNTED);
122 } 122 }
123 123
124 void GvrDeviceProvider::OnVRVsyncProviderReady(
125 const base::Callback<void(mojom::VRVSyncProviderClientPtr)>& callback) {
126 if (!vr_device_)
127 return;
128 vr_device_->OnVRVsyncProviderReady(callback);
129 }
130
124 void GvrDeviceProvider::SwitchToNonPresentingDelegate() { 131 void GvrDeviceProvider::SwitchToNonPresentingDelegate() {
125 GvrDelegateProvider* delegate_provider = GvrDelegateProvider::GetInstance(); 132 GvrDelegateProvider* delegate_provider = GvrDelegateProvider::GetInstance();
126 if (!vr_device_ || !delegate_provider) 133 if (!vr_device_ || !delegate_provider)
127 return; 134 return;
128 135
129 VLOG(1) << "Switching to non-presenting delegate"; 136 VLOG(1) << "Switching to non-presenting delegate";
130 vr_device_->SetDelegate(delegate_provider->GetNonPresentingDelegate()); 137 vr_device_->SetDelegate(delegate_provider->GetNonPresentingDelegate());
131 138
132 // Remove GVR gamepad polling. 139 // Remove GVR gamepad polling.
133 GamepadDataFetcherManager::GetInstance()->RemoveSourceFactory( 140 GamepadDataFetcherManager::GetInstance()->RemoveSourceFactory(
134 GAMEPAD_SOURCE_GVR); 141 GAMEPAD_SOURCE_GVR);
135 } 142 }
136 143
137 void GvrDeviceProvider::SetListeningForActivate(bool listening) { 144 void GvrDeviceProvider::SetListeningForActivate(bool listening) {
138 device::GvrDelegateProvider* delegate_provider = 145 device::GvrDelegateProvider* delegate_provider =
139 device::GvrDelegateProvider::GetInstance(); 146 device::GvrDelegateProvider::GetInstance();
140 if (!delegate_provider) 147 if (!delegate_provider)
141 return; 148 return;
142 149
143 delegate_provider->SetListeningForActivate(listening); 150 delegate_provider->SetListeningForActivate(listening);
144 } 151 }
145 152
146 } // namespace device 153 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698