| Index: chrome/browser/extensions/api/usb/usb_api.h
|
| diff --git a/chrome/browser/extensions/api/usb/usb_api.h b/chrome/browser/extensions/api/usb/usb_api.h
|
| index a778503b58123f9adb3558a95db7d16d0ed282e6..721adf7ab4fa8931259e027ab45cd3e348eda788 100644
|
| --- a/chrome/browser/extensions/api/usb/usb_api.h
|
| +++ b/chrome/browser/extensions/api/usb/usb_api.h
|
| @@ -64,8 +64,6 @@ class UsbFindDevicesFunction : public UsbAsyncApiFunction {
|
|
|
| UsbFindDevicesFunction();
|
|
|
| - static void SetDeviceForTest(UsbDevice* device);
|
| -
|
| protected:
|
| virtual ~UsbFindDevicesFunction();
|
|
|
| @@ -81,6 +79,45 @@ class UsbFindDevicesFunction : public UsbAsyncApiFunction {
|
| scoped_ptr<extensions::api::usb::FindDevices::Params> parameters_;
|
| };
|
|
|
| +class UsbGetDevicesFunction : public UsbAsyncApiFunction {
|
| + public:
|
| + DECLARE_EXTENSION_FUNCTION("usb.getDevices", USB_GETDEVICES)
|
| +
|
| + UsbGetDevicesFunction();
|
| +
|
| + static void SetDeviceForTest(UsbDevice* device);
|
| +
|
| + virtual bool Prepare() OVERRIDE;
|
| + virtual void AsyncWorkStart() OVERRIDE;
|
| +
|
| + protected:
|
| + virtual ~UsbGetDevicesFunction();
|
| +
|
| + private:
|
| + void EnumerationCompletedFileThread(
|
| + scoped_ptr<std::vector<scoped_refptr<UsbDevice> > > devices);
|
| +
|
| + scoped_ptr<base::ListValue> result_;
|
| + scoped_ptr<extensions::api::usb::GetDevices::Params> parameters_;
|
| +};
|
| +
|
| +class UsbOpenDeviceFunction : public UsbAsyncApiFunction {
|
| + public:
|
| + DECLARE_EXTENSION_FUNCTION("usb.openDevice", USB_OPENDEVICE)
|
| +
|
| + UsbOpenDeviceFunction();
|
| +
|
| + virtual bool Prepare() OVERRIDE;
|
| + virtual void AsyncWorkStart() OVERRIDE;
|
| +
|
| + protected:
|
| + virtual ~UsbOpenDeviceFunction();
|
| +
|
| + private:
|
| + scoped_refptr<UsbDeviceHandle> handle_;
|
| + scoped_ptr<extensions::api::usb::OpenDevice::Params> parameters_;
|
| +};
|
| +
|
| class UsbListInterfacesFunction : public UsbAsyncApiFunction {
|
| public:
|
| DECLARE_EXTENSION_FUNCTION("usb.listInterfaces", USB_LISTINTERFACES)
|
|
|