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/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 DCHECK(thread_checker_.CalledOnValidThread()); | 119 DCHECK(thread_checker_.CalledOnValidThread()); |
120 | 120 |
121 return static_cast<unsigned int>(devices_.size()); | 121 return static_cast<unsigned int>(devices_.size()); |
122 } | 122 } |
123 | 123 |
124 void VRDeviceManager::ListeningForActivateChanged(bool listening) { | 124 void VRDeviceManager::ListeningForActivateChanged(bool listening) { |
125 DCHECK(thread_checker_.CalledOnValidThread()); | 125 DCHECK(thread_checker_.CalledOnValidThread()); |
126 | 126 |
127 bool activate_listeners = listening; | 127 bool activate_listeners = listening; |
128 if (!activate_listeners) { | 128 if (!activate_listeners) { |
129 for (const auto& service : services_) { | 129 for (auto* service : services_) { |
130 if (service->listening_for_activate()) { | 130 if (service->listening_for_activate()) { |
131 activate_listeners = true; | 131 activate_listeners = true; |
132 break; | 132 break; |
133 } | 133 } |
134 } | 134 } |
135 } | 135 } |
136 | 136 |
137 // Notify all the providers if this changes | 137 // Notify all the providers if this changes |
138 if (has_activate_listeners_ != activate_listeners) { | 138 if (has_activate_listeners_ != activate_listeners) { |
139 has_activate_listeners_ = activate_listeners; | 139 has_activate_listeners_ = activate_listeners; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 for (const auto& provider : providers_) | 187 for (const auto& provider : providers_) |
188 provider->PollEvents(); | 188 provider->PollEvents(); |
189 } | 189 } |
190 | 190 |
191 void VRDeviceManager::StopSchedulingPollEvents() { | 191 void VRDeviceManager::StopSchedulingPollEvents() { |
192 if (has_scheduled_poll_) | 192 if (has_scheduled_poll_) |
193 timer_.Stop(); | 193 timer_.Stop(); |
194 } | 194 } |
195 | 195 |
196 } // namespace device | 196 } // namespace device |
OLD | NEW |