OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 | 5 |
6 #ifndef CHROME_BROWSER_USB_USB_DEVICE_H_ | 6 #ifndef CHROME_BROWSER_USB_USB_DEVICE_H_ |
7 #define CHROME_BROWSER_USB_USB_DEVICE_H_ | 7 #define CHROME_BROWSER_USB_USB_DEVICE_H_ |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 uint16 product_id, | 66 uint16 product_id, |
67 uint32 unique_id); | 67 uint32 unique_id); |
68 | 68 |
69 // Constructor called in test only. | 69 // Constructor called in test only. |
70 UsbDevice(); | 70 UsbDevice(); |
71 virtual ~UsbDevice(); | 71 virtual ~UsbDevice(); |
72 | 72 |
73 // Called only be UsbService. | 73 // Called only be UsbService. |
74 virtual void OnDisconnect(); | 74 virtual void OnDisconnect(); |
75 | 75 |
76 #if defined(OS_CHROMEOS) | |
77 // This method is called when permission broker replied our request. | |
78 // We will simply relay it to FILE thread. | |
79 // |callback| comes first because it will be base::Bind'ed. | |
80 void OnRequestUsbAccessReplied( | |
81 const base::Callback<void(bool success)>& callback, | |
82 bool success); | |
83 #endif // OS_CHROMEOS | |
84 | |
85 private: | 76 private: |
86 PlatformUsbDevice platform_device_; | 77 PlatformUsbDevice platform_device_; |
87 uint16 vendor_id_; | 78 uint16 vendor_id_; |
88 uint16 product_id_; | 79 uint16 product_id_; |
89 uint32 unique_id_; | 80 uint32 unique_id_; |
90 | 81 |
91 // Retain the context so that it will not be released before UsbDevice. | 82 // Retain the context so that it will not be released before UsbDevice. |
92 scoped_refptr<UsbContext> context_; | 83 scoped_refptr<UsbContext> context_; |
93 | 84 |
94 // Opened handles. | 85 // Opened handles. |
95 typedef std::vector<scoped_refptr<UsbDeviceHandle> > HandlesVector; | 86 typedef std::vector<scoped_refptr<UsbDeviceHandle> > HandlesVector; |
96 HandlesVector handles_; | 87 HandlesVector handles_; |
97 | 88 |
98 base::ThreadChecker thread_checker_; | 89 base::ThreadChecker thread_checker_; |
99 | 90 |
100 DISALLOW_COPY_AND_ASSIGN(UsbDevice); | 91 DISALLOW_COPY_AND_ASSIGN(UsbDevice); |
101 }; | 92 }; |
102 | 93 |
103 #endif // CHROME_BROWSER_USB_USB_DEVICE_H_ | 94 #endif // CHROME_BROWSER_USB_USB_DEVICE_H_ |
OLD | NEW |