| 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_H_ | 5 #ifndef DEVICE_USB_USB_DEVICE_H_ |
| 6 #define DEVICE_USB_USB_DEVICE_H_ | 6 #define DEVICE_USB_USB_DEVICE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // Creates a UsbDeviceHandle for further manipulation. | 44 // Creates a UsbDeviceHandle for further manipulation. |
| 45 // Blocking method. Must be called on FILE thread. | 45 // Blocking method. Must be called on FILE thread. |
| 46 virtual scoped_refptr<UsbDeviceHandle> Open() = 0; | 46 virtual scoped_refptr<UsbDeviceHandle> Open() = 0; |
| 47 | 47 |
| 48 // Explicitly closes a device handle. This method will be automatically called | 48 // Explicitly closes a device handle. This method will be automatically called |
| 49 // by the destructor of a UsbDeviceHandle as well. | 49 // by the destructor of a UsbDeviceHandle as well. |
| 50 // Closing a closed handle is a safe | 50 // Closing a closed handle is a safe |
| 51 // Blocking method. Must be called on FILE thread. | 51 // Blocking method. Must be called on FILE thread. |
| 52 virtual bool Close(scoped_refptr<UsbDeviceHandle> handle) = 0; | 52 virtual bool Close(scoped_refptr<UsbDeviceHandle> handle) = 0; |
| 53 | 53 |
| 54 // Gets the UsbConfigDescriptor for the active device configuration. | 54 // Gets the UsbConfigDescriptor for the active device configuration or nullptr |
| 55 // if the device is unconfigured. |
| 55 // Blocking method. Must be called on FILE thread. | 56 // Blocking method. Must be called on FILE thread. |
| 56 virtual const UsbConfigDescriptor& GetConfiguration() = 0; | 57 virtual const UsbConfigDescriptor* GetConfiguration() = 0; |
| 57 | 58 |
| 58 // Gets the manufacturer string of the device, or returns false. | 59 // Gets the manufacturer string of the device, or returns false. |
| 59 // Blocking method. Must be called on FILE thread. | 60 // Blocking method. Must be called on FILE thread. |
| 60 // TODO(reillyg): Make this available from the UI thread. crbug.com/427985 | 61 // TODO(reillyg): Make this available from the UI thread. crbug.com/427985 |
| 61 virtual bool GetManufacturer(base::string16* manufacturer) = 0; | 62 virtual bool GetManufacturer(base::string16* manufacturer) = 0; |
| 62 | 63 |
| 63 // Gets the product string of the device, or returns false. | 64 // Gets the product string of the device, or returns false. |
| 64 // Blocking method. Must be called on FILE thread. | 65 // Blocking method. Must be called on FILE thread. |
| 65 // TODO(reillyg): Make this available from the UI thread. crbug.com/427985 | 66 // TODO(reillyg): Make this available from the UI thread. crbug.com/427985 |
| 66 virtual bool GetProduct(base::string16* product) = 0; | 67 virtual bool GetProduct(base::string16* product) = 0; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 87 const uint32 unique_id_; | 88 const uint32 unique_id_; |
| 88 | 89 |
| 89 ObserverList<Observer> observer_list_; | 90 ObserverList<Observer> observer_list_; |
| 90 | 91 |
| 91 DISALLOW_COPY_AND_ASSIGN(UsbDevice); | 92 DISALLOW_COPY_AND_ASSIGN(UsbDevice); |
| 92 }; | 93 }; |
| 93 | 94 |
| 94 } // namespace device | 95 } // namespace device |
| 95 | 96 |
| 96 #endif // DEVICE_USB_USB_DEVICE_H_ | 97 #endif // DEVICE_USB_USB_DEVICE_H_ |
| OLD | NEW |