Index: extensions/common/api/usb.idl |
diff --git a/extensions/common/api/usb.idl b/extensions/common/api/usb.idl |
index af6d55054c261a7b123e729536c8fda7414e36c6..1bfc4ed9578b5769bf82398c2e513553b3bc398f 100644 |
--- a/extensions/common/api/usb.idl |
+++ b/extensions/common/api/usb.idl |
@@ -186,7 +186,7 @@ namespace usb { |
// will return all devices the app has permission for. |
DeviceFilter[]? filters; |
}; |
- |
+ |
dictionary EnumerateDevicesAndRequestAccessOptions { |
// The device vendor ID. |
long vendorId; |
@@ -197,6 +197,14 @@ namespace usb { |
long? interfaceId; |
}; |
+ dictionary DevicePromptOptions { |
+ // Allow the user to select multiple devices. |
+ boolean? multiple; |
+ // Filter the list of devices presented to the user. If multiple filters are |
+ // provided devices matching any filter will be displayed. |
+ DeviceFilter[]? filters; |
+ }; |
+ |
callback VoidCallback = void (); |
callback GetDevicesCallback = void (Device[] devices); |
callback RequestAccessCallback = void (boolean success); |
@@ -214,6 +222,16 @@ namespace usb { |
static void getDevices(EnumerateDevicesOptions options, |
GetDevicesCallback callback); |
+ // Presents a device picker to the user and returns the $(ref:Device)s |
+ // selected. |
+ // If the user cancels the picker devices will be empty. A user gesture |
+ // is required for the dialog to display. Without a user gesture, the |
+ // callback will run as though the user cancelled. |
+ // |options|: Configuration of the device picker dialog box. |
+ // |callback|: Invoked with a list of chosen $(ref:Device)s. |
+ static void getUserSelectedDevices(DevicePromptOptions options, |
+ GetDevicesCallback callback); |
+ |
// Requests access from the permission broker to a device claimed by |
// ChromeOS if the given interface on the device is not claimed. |
// |