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

Unified Diff: chrome/browser/extensions/api/usb/usb_api.h

Issue 12471013: Add chrome.usb.listInterfaces API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase of PS10 Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/usb/usb_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a828bade91a37a8212a2227e487659a0fd6e8b4d..f2230168bab27d3d71f3bacab42d8ea78c34cc19 100644
--- a/chrome/browser/extensions/api/usb/usb_api.h
+++ b/chrome/browser/extensions/api/usb/usb_api.h
@@ -44,9 +44,9 @@ class UsbAsyncApiTransferFunction : public UsbAsyncApiFunction {
virtual ~UsbAsyncApiTransferFunction();
bool ConvertDirectionSafely(const extensions::api::usb::Direction& input,
- UsbDevice::TransferDirection* output);
+ UsbEndpointDirection* output);
bool ConvertRequestTypeSafely(const extensions::api::usb::RequestType& input,
- UsbDevice::TransferRequestType* output);
+ UsbDevice::TransferRequestType* output);
bool ConvertRecipientSafely(const extensions::api::usb::Recipient& input,
UsbDevice::TransferRecipient* output);
@@ -77,6 +77,36 @@ class UsbFindDevicesFunction : public UsbAsyncApiFunction {
scoped_ptr<extensions::api::usb::FindDevices::Params> parameters_;
};
+class UsbListInterfacesFunction : public UsbAsyncApiFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION("usb.listInterfaces", USB_LISTINTERFACES)
+
+ UsbListInterfacesFunction();
+
+ protected:
+ virtual ~UsbListInterfacesFunction();
+
+ virtual bool Prepare() OVERRIDE;
+ virtual void AsyncWorkStart() OVERRIDE;
+
+ private:
+ void OnCompleted(bool success);
+
+ bool ConvertDirectionSafely(const UsbEndpointDirection& input,
+ extensions::api::usb::Direction* output);
+ bool ConvertSynchronizationTypeSafely(
+ const UsbSynchronizationType& input,
+ extensions::api::usb::SynchronizationType* output);
+ bool ConvertTransferTypeSafely(const UsbTransferType& input,
+ extensions::api::usb::TransferType* output);
+ bool ConvertUsageTypeSafely(const UsbUsageType& input,
+ extensions::api::usb::UsageType* output);
+
+ scoped_ptr<base::ListValue> result_;
+ scoped_refptr<UsbConfigDescriptor> config_;
+ scoped_ptr<extensions::api::usb::ListInterfaces::Params> parameters_;
+};
+
class UsbCloseDeviceFunction : public UsbAsyncApiFunction {
public:
DECLARE_EXTENSION_FUNCTION("usb.closeDevice", USB_CLOSEDEVICE)
« no previous file with comments | « no previous file | chrome/browser/extensions/api/usb/usb_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698