OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/hid/hid_service.h" | 5 #include "device/hid/hid_service.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 83 } |
84 } | 84 } |
85 | 85 |
86 void HidService::RemoveDevice(const HidDeviceId& device_id) { | 86 void HidService::RemoveDevice(const HidDeviceId& device_id) { |
87 DCHECK(thread_checker_.CalledOnValidThread()); | 87 DCHECK(thread_checker_.CalledOnValidThread()); |
88 DeviceMap::iterator it = devices_.find(device_id); | 88 DeviceMap::iterator it = devices_.find(device_id); |
89 if (it != devices_.end()) | 89 if (it != devices_.end()) |
90 devices_.erase(it); | 90 devices_.erase(it); |
91 } | 91 } |
92 | 92 |
| 93 const HidService::DeviceMap& HidService::GetDevicesNoEnumerate() const { |
| 94 return devices_; |
| 95 } |
| 96 |
93 HidService* HidService::GetInstance() { | 97 HidService* HidService::GetInstance() { |
94 if (!g_hid_service_ptr.Get().get()) | 98 if (!g_hid_service_ptr.Get().get()) |
95 g_hid_service_ptr.Get().reset(CreateInstance()); | 99 g_hid_service_ptr.Get().reset(CreateInstance()); |
96 return g_hid_service_ptr.Get().get(); | 100 return g_hid_service_ptr.Get().get(); |
97 } | 101 } |
98 | 102 |
99 } // namespace device | 103 } // namespace device |
OLD | NEW |