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 "extensions/browser/api/usb_private/usb_private_api.h" | 5 #include "extensions/browser/api/usb_private/usb_private_api.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "components/usb_service/usb_device_filter.h" | |
13 #include "components/usb_service/usb_device_handle.h" | |
14 #include "components/usb_service/usb_service.h" | |
15 #include "device/core/device_client.h" | 12 #include "device/core/device_client.h" |
| 13 #include "device/usb/usb_device_filter.h" |
| 14 #include "device/usb/usb_device_handle.h" |
16 #include "device/usb/usb_ids.h" | 15 #include "device/usb/usb_ids.h" |
| 16 #include "device/usb/usb_service.h" |
17 #include "extensions/common/api/usb_private.h" | 17 #include "extensions/common/api/usb_private.h" |
18 | 18 |
19 namespace usb = extensions::core_api::usb; | 19 namespace usb = extensions::core_api::usb; |
20 namespace usb_private = extensions::core_api::usb_private; | 20 namespace usb_private = extensions::core_api::usb_private; |
21 namespace GetDevices = usb_private::GetDevices; | 21 namespace GetDevices = usb_private::GetDevices; |
22 namespace GetDeviceInfo = usb_private::GetDeviceInfo; | 22 namespace GetDeviceInfo = usb_private::GetDeviceInfo; |
23 | 23 |
24 using content::BrowserThread; | 24 using content::BrowserThread; |
25 using usb_service::UsbDevice; | 25 using device::UsbDevice; |
26 using usb_service::UsbDeviceFilter; | 26 using device::UsbDeviceFilter; |
27 using usb_service::UsbDeviceHandle; | 27 using device::UsbDeviceHandle; |
28 using usb_service::UsbService; | 28 using device::UsbService; |
29 | 29 |
30 typedef std::vector<scoped_refptr<UsbDevice> > DeviceVector; | 30 typedef std::vector<scoped_refptr<UsbDevice> > DeviceVector; |
31 | 31 |
32 namespace { | 32 namespace { |
33 | 33 |
34 const char kErrorInitService[] = "Failed to initialize USB service."; | 34 const char kErrorInitService[] = "Failed to initialize USB service."; |
35 const char kErrorNoDevice[] = "No such device."; | 35 const char kErrorNoDevice[] = "No such device."; |
36 const char kErrorOpen[] = "Failed to open device."; | 36 const char kErrorOpen[] = "Failed to open device."; |
37 | 37 |
38 } // namespace | 38 } // namespace |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 if (device_handle->GetSerial(&utf16)) { | 139 if (device_handle->GetSerial(&utf16)) { |
140 device_info.serial_string.reset(new std::string(base::UTF16ToUTF8(utf16))); | 140 device_info.serial_string.reset(new std::string(base::UTF16ToUTF8(utf16))); |
141 } | 141 } |
142 | 142 |
143 SetResult(device_info.ToValue().release()); | 143 SetResult(device_info.ToValue().release()); |
144 AsyncWorkCompleted(); | 144 AsyncWorkCompleted(); |
145 } | 145 } |
146 | 146 |
147 } // namespace extensions | 147 } // namespace extensions |
OLD | NEW |