| 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 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 std::vector<scoped_refptr<usb_service::UsbDeviceHandle> > device_handles_; | 83 std::vector<scoped_refptr<usb_service::UsbDeviceHandle> > device_handles_; |
| 84 scoped_ptr<extensions::api::usb::FindDevices::Params> parameters_; | 84 scoped_ptr<extensions::api::usb::FindDevices::Params> parameters_; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 class UsbGetDevicesFunction : public UsbAsyncApiFunction { | 87 class UsbGetDevicesFunction : public UsbAsyncApiFunction { |
| 88 public: | 88 public: |
| 89 DECLARE_EXTENSION_FUNCTION("usb.getDevices", USB_GETDEVICES) | 89 DECLARE_EXTENSION_FUNCTION("usb.getDevices", USB_GETDEVICES) |
| 90 | 90 |
| 91 UsbGetDevicesFunction(); | 91 UsbGetDevicesFunction(); |
| 92 | 92 |
| 93 static void SetDeviceForTest(usb_service::UsbDevice* device); | |
| 94 | |
| 95 virtual bool Prepare() OVERRIDE; | 93 virtual bool Prepare() OVERRIDE; |
| 96 virtual void AsyncWorkStart() OVERRIDE; | 94 virtual void AsyncWorkStart() OVERRIDE; |
| 97 | 95 |
| 98 protected: | 96 protected: |
| 99 virtual ~UsbGetDevicesFunction(); | 97 virtual ~UsbGetDevicesFunction(); |
| 100 | 98 |
| 101 private: | 99 private: |
| 102 void EnumerationCompletedFileThread( | 100 void EnumerationCompletedFileThread( |
| 103 scoped_ptr<std::vector<scoped_refptr<usb_service::UsbDevice> > > devices); | 101 scoped_ptr<std::vector<scoped_refptr<usb_service::UsbDevice> > > devices); |
| 104 | 102 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 305 |
| 308 virtual bool Prepare() OVERRIDE; | 306 virtual bool Prepare() OVERRIDE; |
| 309 virtual void AsyncWorkStart() OVERRIDE; | 307 virtual void AsyncWorkStart() OVERRIDE; |
| 310 | 308 |
| 311 private: | 309 private: |
| 312 scoped_ptr<extensions::api::usb::ResetDevice::Params> parameters_; | 310 scoped_ptr<extensions::api::usb::ResetDevice::Params> parameters_; |
| 313 }; | 311 }; |
| 314 } // namespace extensions | 312 } // namespace extensions |
| 315 | 313 |
| 316 #endif // CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_ | 314 #endif // CHROME_BROWSER_EXTENSIONS_API_USB_USB_API_H_ |
| OLD | NEW |