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

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

Issue 2029703002: Moving VR service from /content/browser to /device (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added nogncheck to failing include Created 4 years, 6 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_device_manager.h ('k') | device/vr/vr_device_manager_unittest.cc » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/browser/vr/vr_device_manager.h" 5 #include "device/vr/vr_device_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 12
13 #if defined(OS_ANDROID) 13 #if defined(OS_ANDROID)
14 #include "content/browser/vr/android/cardboard/cardboard_vr_device_provider.h" 14 #include "device/vr/android/cardboard/cardboard_vr_device_provider.h"
15 #endif 15 #endif
16 16
17 namespace content { 17 namespace device {
18 18
19 namespace { 19 namespace {
20 VRDeviceManager* g_vr_device_manager = nullptr; 20 VRDeviceManager* g_vr_device_manager = nullptr;
21 } 21 }
22 22
23 VRDeviceManager::VRDeviceManager() 23 VRDeviceManager::VRDeviceManager()
24 : vr_initialized_(false), keep_alive_(false) { 24 : vr_initialized_(false), keep_alive_(false) {
25 bindings_.set_connection_error_handler( 25 bindings_.set_connection_error_handler(
26 base::Bind(&VRDeviceManager::OnConnectionError, base::Unretained(this))); 26 base::Bind(&VRDeviceManager::OnConnectionError, base::Unretained(this)));
27 // Register VRDeviceProviders for the current platform 27 // Register VRDeviceProviders for the current platform
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 void VRDeviceManager::RegisterProvider( 133 void VRDeviceManager::RegisterProvider(
134 std::unique_ptr<VRDeviceProvider> provider) { 134 std::unique_ptr<VRDeviceProvider> provider) {
135 providers_.push_back(make_linked_ptr(provider.release())); 135 providers_.push_back(make_linked_ptr(provider.release()));
136 } 136 }
137 137
138 void VRDeviceManager::GetDisplays(const GetDisplaysCallback& callback) { 138 void VRDeviceManager::GetDisplays(const GetDisplaysCallback& callback) {
139 callback.Run(GetVRDevices()); 139 callback.Run(GetVRDevices());
140 } 140 }
141 141
142 void VRDeviceManager::GetPose(uint32_t index, 142 void VRDeviceManager::GetPose(uint32_t index, const GetPoseCallback& callback) {
143 const GetPoseCallback& callback) {
144 VRDevice* device = GetDevice(index); 143 VRDevice* device = GetDevice(index);
145 if (device) { 144 if (device) {
146 callback.Run(device->GetPose()); 145 callback.Run(device->GetPose());
147 } else { 146 } else {
148 callback.Run(nullptr); 147 callback.Run(nullptr);
149 } 148 }
150 } 149 }
151 150
152 void VRDeviceManager::ResetPose(uint32_t index) { 151 void VRDeviceManager::ResetPose(uint32_t index) {
153 VRDevice* device = GetDevice(index); 152 VRDevice* device = GetDevice(index);
154 if (device) 153 if (device)
155 device->ResetPose(); 154 device->ResetPose();
156 } 155 }
157 156
158 } // namespace content 157 } // namespace device
OLDNEW
« no previous file with comments | « device/vr/vr_device_manager.h ('k') | device/vr/vr_device_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698