| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // On ChromeOS the permission_broker service is used to change the ownership | 68 // On ChromeOS the permission_broker service is used to change the ownership |
| 69 // of USB device nodes so that Chrome can open them. On other platforms these | 69 // of USB device nodes so that Chrome can open them. On other platforms these |
| 70 // functions are no-ops and always return true. | 70 // functions are no-ops and always return true. |
| 71 virtual void CheckUsbAccess(const ResultCallback& callback); | 71 virtual void CheckUsbAccess(const ResultCallback& callback); |
| 72 | 72 |
| 73 // Creates a UsbDeviceHandle for further manipulation. | 73 // Creates a UsbDeviceHandle for further manipulation. |
| 74 virtual void Open(const OpenCallback& callback) = 0; | 74 virtual void Open(const OpenCallback& callback) = 0; |
| 75 | 75 |
| 76 // Gets the UsbConfigDescriptor for the active device configuration or nullptr | 76 // Gets the UsbConfigDescriptor for the active device configuration or nullptr |
| 77 // if the device is unconfigured. | 77 // if the device is unconfigured. |
| 78 virtual const UsbConfigDescriptor* GetActiveConfiguration() = 0; | 78 virtual const UsbConfigDescriptor* GetActiveConfiguration() const = 0; |
| 79 | 79 |
| 80 void AddObserver(Observer* observer); | 80 void AddObserver(Observer* observer); |
| 81 void RemoveObserver(Observer* observer); | 81 void RemoveObserver(Observer* observer); |
| 82 | 82 |
| 83 protected: | 83 protected: |
| 84 friend class UsbService; | 84 friend class UsbService; |
| 85 | 85 |
| 86 UsbDevice(uint16_t vendor_id, | 86 UsbDevice(uint16_t vendor_id, |
| 87 uint16_t product_id, | 87 uint16_t product_id, |
| 88 const base::string16& manufacturer_string, | 88 const base::string16& manufacturer_string, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 112 const uint16_t product_id_; | 112 const uint16_t product_id_; |
| 113 | 113 |
| 114 base::ObserverList<Observer, true> observer_list_; | 114 base::ObserverList<Observer, true> observer_list_; |
| 115 | 115 |
| 116 DISALLOW_COPY_AND_ASSIGN(UsbDevice); | 116 DISALLOW_COPY_AND_ASSIGN(UsbDevice); |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 } // namespace device | 119 } // namespace device |
| 120 | 120 |
| 121 #endif // DEVICE_USB_USB_DEVICE_H_ | 121 #endif // DEVICE_USB_USB_DEVICE_H_ |
| OLD | NEW |