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_private = extensions::core_api::usb_private; | 19 namespace usb_private = extensions::core_api::usb_private; |
20 namespace GetDevices = usb_private::GetDevices; | 20 namespace GetDevices = usb_private::GetDevices; |
21 namespace GetDeviceInfo = usb_private::GetDeviceInfo; | 21 namespace GetDeviceInfo = usb_private::GetDeviceInfo; |
22 | 22 |
23 using content::BrowserThread; | 23 using content::BrowserThread; |
24 using usb_service::UsbDevice; | 24 using device::UsbDevice; |
25 using usb_service::UsbDeviceFilter; | 25 using device::UsbDeviceFilter; |
26 using usb_service::UsbDeviceHandle; | 26 using device::UsbDeviceHandle; |
27 using usb_service::UsbService; | 27 using device::UsbService; |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
31 const char kErrorInitService[] = "Failed to initialize USB service."; | 31 const char kErrorInitService[] = "Failed to initialize USB service."; |
32 const char kErrorNoDevice[] = "No such device."; | 32 const char kErrorNoDevice[] = "No such device."; |
33 const char kErrorOpen[] = "Failed to open device."; | 33 const char kErrorOpen[] = "Failed to open device."; |
34 | 34 |
35 } // namespace | 35 } // namespace |
36 | 36 |
37 namespace extensions { | 37 namespace extensions { |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 165 |
166 if (device_handle->GetSerial(&utf16)) { | 166 if (device_handle->GetSerial(&utf16)) { |
167 device_info.serial_string.reset(new std::string(base::UTF16ToUTF8(utf16))); | 167 device_info.serial_string.reset(new std::string(base::UTF16ToUTF8(utf16))); |
168 } | 168 } |
169 | 169 |
170 SetResult(device_info.ToValue().release()); | 170 SetResult(device_info.ToValue().release()); |
171 AsyncWorkCompleted(); | 171 AsyncWorkCompleted(); |
172 } | 172 } |
173 | 173 |
174 } // namespace extensions | 174 } // namespace extensions |
OLD | NEW |