Chromium Code Reviews| Index: extensions/common/api/hid.idl |
| diff --git a/extensions/common/api/hid.idl b/extensions/common/api/hid.idl |
| index f695176669c2b50cd40990c2be8e4edcc4d193e8..ac1d44d26909bc16b14ce3ad3500f65e119ecccc 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(DevicePromptOptions options, |
|
Devlin
2015/05/05 22:19:51
Why is |options| required?
Reilly Grant (use Gerrit)
2015/05/06 00:52:53
No reason.
|
| + 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, |