OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 static void SetDeviceForTest(UsbDevice* device); | 64 static void SetDeviceForTest(UsbDevice* device); |
65 | 65 |
66 protected: | 66 protected: |
67 virtual ~UsbFindDevicesFunction(); | 67 virtual ~UsbFindDevicesFunction(); |
68 | 68 |
69 virtual bool Prepare() OVERRIDE; | 69 virtual bool Prepare() OVERRIDE; |
70 virtual void AsyncWorkStart() OVERRIDE; | 70 virtual void AsyncWorkStart() OVERRIDE; |
71 | 71 |
72 private: | 72 private: |
| 73 void OnCompleted(); |
| 74 |
| 75 scoped_ptr<base::ListValue> result_; |
| 76 std::vector<scoped_refptr<UsbDevice> > devices_; |
73 scoped_ptr<extensions::api::usb::FindDevices::Params> parameters_; | 77 scoped_ptr<extensions::api::usb::FindDevices::Params> parameters_; |
74 }; | 78 }; |
75 | 79 |
76 class UsbCloseDeviceFunction : public UsbAsyncApiFunction { | 80 class UsbCloseDeviceFunction : public UsbAsyncApiFunction { |
77 public: | 81 public: |
78 DECLARE_EXTENSION_FUNCTION("usb.closeDevice", USB_CLOSEDEVICE) | 82 DECLARE_EXTENSION_FUNCTION("usb.closeDevice", USB_CLOSEDEVICE) |
79 | 83 |
80 UsbCloseDeviceFunction(); | 84 UsbCloseDeviceFunction(); |
81 | 85 |
82 protected: | 86 protected: |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 virtual bool Prepare() OVERRIDE; | 211 virtual bool Prepare() OVERRIDE; |
208 virtual void AsyncWorkStart() OVERRIDE; | 212 virtual void AsyncWorkStart() OVERRIDE; |
209 | 213 |
210 private: | 214 private: |
211 scoped_ptr<extensions::api::usb::IsochronousTransfer::Params> parameters_; | 215 scoped_ptr<extensions::api::usb::IsochronousTransfer::Params> parameters_; |
212 }; | 216 }; |
213 | 217 |
214 } // namespace extensions | 218 } // namespace extensions |
215 | 219 |
216 #endif // CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_ | 220 #endif // CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_ |
OLD | NEW |