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

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

Issue 463493006: Add chrome.usbPrivate API for use by USB device WEBUI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change "Google Inc." to "Test Manufacturer". 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/common/api/api.gyp ('k') | extensions/extensions.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/api/usb_private.idl
diff --git a/extensions/common/api/usb_private.idl b/extensions/common/api/usb_private.idl
new file mode 100644
index 0000000000000000000000000000000000000000..457da232416c8b247b4229fa90bcde8f65f53ac8
--- /dev/null
+++ b/extensions/common/api/usb_private.idl
@@ -0,0 +1,55 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Use the <code>chrome.usbPrivate</code> API to interact with connected USB
+// devices. This API provides private extensions to the <code>chrome.usb</code>
+// API which should only be available to trusted pages.
+namespace usbPrivate {
+
+ // Properties for matching devices. A device matches of any of its interfaces
+ // match the given properties. An empty dictionary matches any device.
+ dictionary DeviceFilter {
+ // Device-level matching criteria:
+ long? vendorId;
+ // Checked only if the vendorId matches.
+ long? productId;
+
+ // Per-interface matching criteria:
+ long? interfaceClass;
+ // Checked only if the interfaceClass matches.
+ long? interfaceSubclass;
+ // Checked only if the interfaceSubclass matches.
+ long? interfaceProtocol;
+ };
+
+ dictionary DeviceInfo {
+ long vendorId; // idVendor from the device
+ long productId; // idProduct from the device
+
+ // Vendor and product names from an internal database.
+ DOMString? vendorName;
+ DOMString? productName;
+
+ // iManufacturer, iProduct and iSerial strings from the device.
+ DOMString? manufacturerString;
+ DOMString? productString;
+ DOMString? serialString;
+ };
+
+ callback GetDevicesCallback = void (long[] deviceIds);
+ callback GetDeviceInfoCallback = void (DeviceInfo deviceInfo);
+
+ interface Functions {
+ // Lists USB devices matching any of the given filters.
+ // |filters|: The properties to search for on target devices.
+ // |callback|: Invoked with a list of device IDs on complete.
+ static void getDevices(DeviceFilter[] filters,
+ GetDevicesCallback callback);
+
+ // Gets basic display information about a device.
+ // |deviceId|: The device ID (from |getDevices|).
+ // |callback|: Invoked with |DeviceInfo| from the device.
+ static void getDeviceInfo(long deviceId, GetDeviceInfoCallback callback);
+ };
+};
« no previous file with comments | « extensions/common/api/api.gyp ('k') | extensions/extensions.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698