OLD | NEW |
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 "device/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" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 mojo::Array<VRDisplayPtr> VRDeviceManager::GetVRDevices() { | 79 mojo::Array<VRDisplayPtr> VRDeviceManager::GetVRDevices() { |
80 DCHECK(thread_checker_.CalledOnValidThread()); | 80 DCHECK(thread_checker_.CalledOnValidThread()); |
81 | 81 |
82 InitializeProviders(); | 82 InitializeProviders(); |
83 | 83 |
84 std::vector<VRDevice*> devices; | 84 std::vector<VRDevice*> devices; |
85 for (const auto& provider : providers_) | 85 for (const auto& provider : providers_) |
86 provider->GetDevices(&devices); | 86 provider->GetDevices(&devices); |
87 | 87 |
88 mojo::Array<VRDisplayPtr> out_devices; | 88 mojo::Array<VRDisplayPtr> out_devices; |
89 for (const auto& device : devices) { | 89 for (auto* device : devices) { |
90 if (device->id() == VR_DEVICE_LAST_ID) | 90 if (device->id() == VR_DEVICE_LAST_ID) |
91 continue; | 91 continue; |
92 | 92 |
93 if (devices_.find(device->id()) == devices_.end()) | 93 if (devices_.find(device->id()) == devices_.end()) |
94 devices_[device->id()] = device; | 94 devices_[device->id()] = device; |
95 | 95 |
96 VRDisplayPtr vr_device_info = device->GetVRDevice(); | 96 VRDisplayPtr vr_device_info = device->GetVRDevice(); |
97 if (vr_device_info.is_null()) | 97 if (vr_device_info.is_null()) |
98 continue; | 98 continue; |
99 | 99 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 } | 147 } |
148 } | 148 } |
149 | 149 |
150 void VRDeviceManager::ResetPose(uint32_t index) { | 150 void VRDeviceManager::ResetPose(uint32_t index) { |
151 VRDevice* device = GetDevice(index); | 151 VRDevice* device = GetDevice(index); |
152 if (device) | 152 if (device) |
153 device->ResetPose(); | 153 device->ResetPose(); |
154 } | 154 } |
155 | 155 |
156 } // namespace device | 156 } // namespace device |
OLD | NEW |