| 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 COMPONENTS_USB_SERVICE_USB_DEVICE_H_ | 5 #ifndef DEVICE_USB_USB_DEVICE_H_ |
| 6 #define COMPONENTS_USB_SERVICE_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" |
| 11 #include "components/usb_service/usb_service_export.h" | |
| 12 | 11 |
| 13 namespace usb_service { | 12 namespace device { |
| 14 | 13 |
| 15 class UsbDeviceHandle; | 14 class UsbDeviceHandle; |
| 16 class UsbConfigDescriptor; | 15 class UsbConfigDescriptor; |
| 17 | 16 |
| 18 // A UsbDevice object represents a detected USB device, providing basic | 17 // A UsbDevice object represents a detected USB device, providing basic |
| 19 // information about it. For further manipulation of the device, a | 18 // information about it. For further manipulation of the device, a |
| 20 // UsbDeviceHandle must be created from Open() method. | 19 // UsbDeviceHandle must be created from Open() method. |
| 21 class USB_SERVICE_EXPORT UsbDevice | 20 class UsbDevice : public base::RefCountedThreadSafe<UsbDevice> { |
| 22 : public base::RefCountedThreadSafe<UsbDevice> { | |
| 23 public: | 21 public: |
| 24 // Accessors to basic information. | 22 // Accessors to basic information. |
| 25 uint16 vendor_id() const { return vendor_id_; } | 23 uint16 vendor_id() const { return vendor_id_; } |
| 26 uint16 product_id() const { return product_id_; } | 24 uint16 product_id() const { return product_id_; } |
| 27 uint32 unique_id() const { return unique_id_; } | 25 uint32 unique_id() const { return unique_id_; } |
| 28 | 26 |
| 29 #if defined(OS_CHROMEOS) | 27 #if defined(OS_CHROMEOS) |
| 30 // On ChromeOS, if an interface of a claimed device is not claimed, the | 28 // On ChromeOS, if an interface of a claimed device is not claimed, the |
| 31 // permission broker can change the owner of the device so that the unclaimed | 29 // permission broker can change the owner of the device so that the unclaimed |
| 32 // interfaces can be used. If this argument is missing, permission broker will | 30 // interfaces can be used. If this argument is missing, permission broker will |
| (...skipping 27 matching lines...) Expand all Loading... |
| 60 private: | 58 private: |
| 61 friend class base::RefCountedThreadSafe<UsbDevice>; | 59 friend class base::RefCountedThreadSafe<UsbDevice>; |
| 62 | 60 |
| 63 const uint16 vendor_id_; | 61 const uint16 vendor_id_; |
| 64 const uint16 product_id_; | 62 const uint16 product_id_; |
| 65 const uint32 unique_id_; | 63 const uint32 unique_id_; |
| 66 | 64 |
| 67 DISALLOW_COPY_AND_ASSIGN(UsbDevice); | 65 DISALLOW_COPY_AND_ASSIGN(UsbDevice); |
| 68 }; | 66 }; |
| 69 | 67 |
| 70 } // namespace usb_service | 68 } // namespace device |
| 71 | 69 |
| 72 #endif // COMPONENTS_USB_SERVICE_USB_DEVICE_H_ | 70 #endif // DEVICE_USB_USB_DEVICE_H_ |
| OLD | NEW |