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

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

Issue 1115213004: Add chrome.hid.getUserSelectedDevices API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 6 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
Index: extensions/common/api/hid.idl
diff --git a/extensions/common/api/hid.idl b/extensions/common/api/hid.idl
index f695176669c2b50cd40990c2be8e4edcc4d193e8..48aaf38e9864f4f293ef35a0a6de719abbec3556 100644
--- a/extensions/common/api/hid.idl
+++ b/extensions/common/api/hid.idl
@@ -64,6 +64,14 @@ namespace hid {
DeviceFilter[]? filters;
};
+ 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 GetDevicesCallback = void (HidDeviceInfo[] devices);
callback ConnectCallback = void (HidConnectInfo connection);
callback DisconnectCallback = void ();
@@ -84,6 +92,17 @@ namespace hid {
static void getDevices(GetDevicesOptions options,
GetDevicesCallback callback);
+ // Presents a device picker to the user and returns $(ref:HidDeviceInfo)
+ // objects for the devices 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. If multiple filters are
+ // provided devices matching any filter will be displayed.
+ // |options|: Configuration of the device picker dialog box.
+ // |callback|: Invoked with a list of chosen $(ref:Device)s.
+ static void getUserSelectedDevices(optional DevicePromptOptions options,
+ GetDevicesCallback callback);
+
// Open a connection to an HID device for communication.
// |deviceId|: The $(ref:HidDeviceInfo.deviceId) of the device to open.
static void connect(long deviceId,
« no previous file with comments | « extensions/common/api/_api_features.json ('k') | extensions/test/data/api_test/hid/get_user_selected_devices/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698