Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: extensions/browser/api/usb_private/usb_private_api.cc

Issue 497363004: Merge components/usb_service into device/usb. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/browser/api/usb_private/DEPS ('k') | extensions/extensions.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « extensions/browser/api/usb_private/DEPS ('k') | extensions/extensions.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698