OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/usb/usb_service.h" | 5 #include "chrome/browser/usb/usb_service.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "chrome/browser/usb/usb_device.h" | 13 #include "chrome/browser/usb/usb_device.h" |
14 #include "third_party/libusb/libusb.h" | 14 #include "third_party/libusb/src/libusb/libusb.h" |
15 | 15 |
16 #if defined(OS_CHROMEOS) | 16 #if defined(OS_CHROMEOS) |
17 #include "chromeos/dbus/dbus_thread_manager.h" | 17 #include "chromeos/dbus/dbus_thread_manager.h" |
18 #include "chromeos/dbus/permission_broker_client.h" | 18 #include "chromeos/dbus/permission_broker_client.h" |
19 #endif // defined(OS_CHROMEOS) | 19 #endif // defined(OS_CHROMEOS) |
20 | 20 |
21 using std::vector; | 21 using std::vector; |
22 | 22 |
23 // The UsbEventHandler works around a design flaw in the libusb interface. There | 23 // The UsbEventHandler works around a design flaw in the libusb interface. There |
24 // is currently no way to signal to libusb that any caller into one of the event | 24 // is currently no way to signal to libusb that any caller into one of the event |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 if (libusb_open(device, &handle)) { | 180 if (libusb_open(device, &handle)) { |
181 LOG(WARNING) << "Could not open device."; | 181 LOG(WARNING) << "Could not open device."; |
182 return NULL; | 182 return NULL; |
183 } | 183 } |
184 | 184 |
185 UsbDevice* wrapper = new UsbDevice(this, handle); | 185 UsbDevice* wrapper = new UsbDevice(this, handle); |
186 devices_[device] = wrapper; | 186 devices_[device] = wrapper; |
187 } | 187 } |
188 return devices_[device]; | 188 return devices_[device]; |
189 } | 189 } |
OLD | NEW |