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

Unified Diff: extensions/common/api/usb.idl

Issue 599303004: Add getUserSelectedDevices to the USB extensions API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add device_permissions_prompt.* to BUILD.gn. Created 6 years, 2 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 | « extensions/common/api/_api_features.json ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
//
« no previous file with comments | « extensions/common/api/_api_features.json ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698