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

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

Issue 514923002: Add more generic filters to the chrome.hid.getDevices API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Document the deprecated properties and the suggested filter replacement. Created 6 years, 4 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/browser/api/hid/hid_device_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/api/hid.idl
diff --git a/extensions/common/api/hid.idl b/extensions/common/api/hid.idl
index c6bb316311968db0d462bea3e9e8464635854e3a..e93f9c256485562fa2ca735326fcdf4b95b23416 100644
--- a/extensions/common/api/hid.idl
+++ b/extensions/common/api/hid.idl
@@ -42,10 +42,27 @@ namespace hid {
long connectionId;
};
- // Searching criteria to enumerate devices with.
+ // Device matching criteria.
+ dictionary DeviceFilter {
+ long? vendorId;
+ // (checked only if the vendor ID matches)
+ long? productId;
+ long? usagePage;
+ // (checked only if the HID usage page matches)
not at google - send to devlin 2014/08/29 00:26:26 This is all going to be generated as https://devel
+ long? usage;
+ };
+
+ // Options passed to <code>getDevices</code>.
dictionary GetDevicesOptions {
- long vendorId;
- long productId;
+ // <b>Note:</b> Deprecated, equivalent to a filter with
+ // <code>vendorId</code> set.
+ long? vendorId;
not at google - send to devlin 2014/08/29 00:26:26 There's a deprecated annotation: [deprecated=Use
+ // <b>Note:</b> Deprecated, equivalent to a filter with
+ // <code>productId</code> set.
+ long? productId;
+ // Devices matching any of the given filters will be returned. Providing an
+ // empty filter list will return all devices the app has permission for.
+ DeviceFilter[]? filters;
};
callback GetDevicesCallback = void (HidDeviceInfo[] devices);
@@ -67,8 +84,7 @@ namespace hid {
callback SendCallback = void();
interface Functions {
- // Enumerate all the connected HID devices specified by the vendorId/
- // productId/interfaceId tuple.
+ // Enumerate all the connected HID devices matching the given properties.
// |options|: The properties to search for on target devices.
// |callback|: Invoked with the <code>HidDeviceInfo</code> array on success.
static void getDevices(GetDevicesOptions options,
« no previous file with comments | « extensions/browser/api/hid/hid_device_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698