Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: device/usb/usb_device.h

Issue 497363004: Merge components/usb_service into device/usb. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/usb/usb_context_unittest.cc ('k') | device/usb/usb_device_filter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « device/usb/usb_context_unittest.cc ('k') | device/usb/usb_device_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698