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 16 matching lines...) Expand all Loading... |
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 virtual void RequestUsbAccess( | 35 virtual void RequestUsbAccess( |
36 int interface_id, | 36 int interface_id, |
37 const base::Callback<void(bool success)>& callback) OVERRIDE; | 37 const base::Callback<void(bool success)>& callback) override; |
38 #endif // OS_CHROMEOS | 38 #endif // OS_CHROMEOS |
39 virtual scoped_refptr<UsbDeviceHandle> Open() OVERRIDE; | 39 virtual scoped_refptr<UsbDeviceHandle> Open() override; |
40 virtual bool Close(scoped_refptr<UsbDeviceHandle> handle) OVERRIDE; | 40 virtual bool Close(scoped_refptr<UsbDeviceHandle> handle) override; |
41 virtual const UsbConfigDescriptor& GetConfiguration() OVERRIDE; | 41 virtual const UsbConfigDescriptor& GetConfiguration() override; |
42 virtual bool GetManufacturer(base::string16* manufacturer) OVERRIDE; | 42 virtual bool GetManufacturer(base::string16* manufacturer) override; |
43 virtual bool GetProduct(base::string16* product) OVERRIDE; | 43 virtual bool GetProduct(base::string16* product) override; |
44 virtual bool GetSerialNumber(base::string16* serial_number) OVERRIDE; | 44 virtual bool GetSerialNumber(base::string16* serial_number) override; |
45 | 45 |
46 protected: | 46 protected: |
47 friend class UsbServiceImpl; | 47 friend class UsbServiceImpl; |
48 | 48 |
49 // Called by UsbServiceImpl only; | 49 // Called by UsbServiceImpl only; |
50 UsbDeviceImpl(scoped_refptr<UsbContext> context, | 50 UsbDeviceImpl(scoped_refptr<UsbContext> context, |
51 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 51 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
52 PlatformUsbDevice platform_device, | 52 PlatformUsbDevice platform_device, |
53 uint16 vendor_id, | 53 uint16 vendor_id, |
54 uint16 product_id, | 54 uint16 product_id, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 // Reference to the UI thread for permission-broker calls. | 87 // Reference to the UI thread for permission-broker calls. |
88 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 88 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
89 | 89 |
90 DISALLOW_COPY_AND_ASSIGN(UsbDeviceImpl); | 90 DISALLOW_COPY_AND_ASSIGN(UsbDeviceImpl); |
91 }; | 91 }; |
92 | 92 |
93 } // namespace device | 93 } // namespace device |
94 | 94 |
95 #endif // DEVICE_USB_USB_DEVICE_IMPL_H_ | 95 #endif // DEVICE_USB_USB_DEVICE_IMPL_H_ |
OLD | NEW |