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 #ifndef DEVICE_USB_USB_DEVICE_IMPL_H_ | 5 #ifndef DEVICE_USB_USB_DEVICE_IMPL_H_ |
6 #define DEVICE_USB_USB_DEVICE_IMPL_H_ | 6 #define DEVICE_USB_USB_DEVICE_IMPL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 class UsbDeviceHandleImpl; | 25 class UsbDeviceHandleImpl; |
26 class UsbContext; | 26 class UsbContext; |
27 | 27 |
28 typedef libusb_device* PlatformUsbDevice; | 28 typedef libusb_device* PlatformUsbDevice; |
29 typedef libusb_config_descriptor* PlatformUsbConfigDescriptor; | 29 typedef libusb_config_descriptor* PlatformUsbConfigDescriptor; |
30 | 30 |
31 class UsbDeviceImpl : public UsbDevice { | 31 class UsbDeviceImpl : public UsbDevice { |
32 public: | 32 public: |
33 // UsbDevice implementation: | 33 // UsbDevice implementation: |
34 #if defined(OS_CHROMEOS) | 34 #if defined(OS_CHROMEOS) |
35 void RequestUsbAccess( | 35 // Only overridden on Chrome OS. |
36 int interface_id, | 36 void CheckUsbAccess(const ResultCallback& callback) override; |
37 const base::Callback<void(bool success)>& callback) override; | 37 void RequestUsbAccess(int interface_id, |
| 38 const ResultCallback& callback) override; |
38 #endif // OS_CHROMEOS | 39 #endif // OS_CHROMEOS |
39 scoped_refptr<UsbDeviceHandle> Open() override; | 40 scoped_refptr<UsbDeviceHandle> Open() override; |
40 bool Close(scoped_refptr<UsbDeviceHandle> handle) override; | 41 bool Close(scoped_refptr<UsbDeviceHandle> handle) override; |
41 const UsbConfigDescriptor* GetConfiguration() override; | 42 const UsbConfigDescriptor* GetConfiguration() override; |
42 bool GetManufacturer(base::string16* manufacturer) override; | 43 bool GetManufacturer(base::string16* manufacturer) override; |
43 bool GetProduct(base::string16* product) override; | 44 bool GetProduct(base::string16* product) override; |
44 bool GetSerialNumber(base::string16* serial_number) override; | 45 bool GetSerialNumber(base::string16* serial_number) override; |
45 | 46 |
46 protected: | 47 protected: |
47 friend class UsbServiceImpl; | 48 friend class UsbServiceImpl; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 100 |
100 // Reference to the UI thread for permission-broker calls. | 101 // Reference to the UI thread for permission-broker calls. |
101 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 102 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
102 | 103 |
103 DISALLOW_COPY_AND_ASSIGN(UsbDeviceImpl); | 104 DISALLOW_COPY_AND_ASSIGN(UsbDeviceImpl); |
104 }; | 105 }; |
105 | 106 |
106 } // namespace device | 107 } // namespace device |
107 | 108 |
108 #endif // DEVICE_USB_USB_DEVICE_IMPL_H_ | 109 #endif // DEVICE_USB_USB_DEVICE_IMPL_H_ |
OLD | NEW |