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_mac.h" | 5 #include "device/hid/hid_service_mac.h" |
6 | 6 |
7 #include <CoreFoundation/CoreFoundation.h> | 7 #include <CoreFoundation/CoreFoundation.h> |
8 #include <IOKit/hid/IOHIDDevice.h> | 8 #include <IOKit/hid/IOHIDDevice.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <set> | 11 #include <set> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/bind.h" | 15 #include "base/bind.h" |
16 #include "base/location.h" | 16 #include "base/location.h" |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "base/mac/foundation_util.h" | 18 #include "base/mac/foundation_util.h" |
19 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
20 #include "base/stl_util.h" | 20 #include "base/stl_util.h" |
21 #include "base/strings/stringprintf.h" | 21 #include "base/strings/stringprintf.h" |
22 #include "base/strings/sys_string_conversions.h" | 22 #include "base/strings/sys_string_conversions.h" |
23 #include "base/thread_task_runner_handle.h" | |
24 #include "base/threading/thread_restrictions.h" | 23 #include "base/threading/thread_restrictions.h" |
| 24 #include "base/threading/thread_task_runner_handle.h" |
25 #include "components/device_event_log/device_event_log.h" | 25 #include "components/device_event_log/device_event_log.h" |
26 #include "device/hid/hid_connection_mac.h" | 26 #include "device/hid/hid_connection_mac.h" |
27 | 27 |
28 namespace device { | 28 namespace device { |
29 | 29 |
30 namespace { | 30 namespace { |
31 | 31 |
32 std::string HexErrorCode(IOReturn error_code) { | 32 std::string HexErrorCode(IOReturn error_code) { |
33 return base::StringPrintf("0x%04x", error_code); | 33 return base::StringPrintf("0x%04x", error_code); |
34 } | 34 } |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 return new HidDeviceInfo( | 261 return new HidDeviceInfo( |
262 entry_id, GetHidIntProperty(hid_device, CFSTR(kIOHIDVendorIDKey)), | 262 entry_id, GetHidIntProperty(hid_device, CFSTR(kIOHIDVendorIDKey)), |
263 GetHidIntProperty(hid_device, CFSTR(kIOHIDProductIDKey)), | 263 GetHidIntProperty(hid_device, CFSTR(kIOHIDProductIDKey)), |
264 GetHidStringProperty(hid_device, CFSTR(kIOHIDProductKey)), | 264 GetHidStringProperty(hid_device, CFSTR(kIOHIDProductKey)), |
265 GetHidStringProperty(hid_device, CFSTR(kIOHIDSerialNumberKey)), | 265 GetHidStringProperty(hid_device, CFSTR(kIOHIDSerialNumberKey)), |
266 kHIDBusTypeUSB, // TODO(reillyg): Detect Bluetooth. crbug.com/443335 | 266 kHIDBusTypeUSB, // TODO(reillyg): Detect Bluetooth. crbug.com/443335 |
267 report_descriptor); | 267 report_descriptor); |
268 } | 268 } |
269 | 269 |
270 } // namespace device | 270 } // namespace device |
OLD | NEW |