Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / extensions / common / api / usb_private.idl
blob457da232416c8b247b4229fa90bcde8f65f53ac8
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Use the <code>chrome.usbPrivate</code> API to interact with connected USB
6 // devices. This API provides private extensions to the <code>chrome.usb</code>
7 // API which should only be available to trusted pages.
8 namespace usbPrivate {
10 // Properties for matching devices. A device matches of any of its interfaces
11 // match the given properties. An empty dictionary matches any device.
12 dictionary DeviceFilter {
13 // Device-level matching criteria:
14 long? vendorId;
15 // Checked only if the vendorId matches.
16 long? productId;
18 // Per-interface matching criteria:
19 long? interfaceClass;
20 // Checked only if the interfaceClass matches.
21 long? interfaceSubclass;
22 // Checked only if the interfaceSubclass matches.
23 long? interfaceProtocol;
26 dictionary DeviceInfo {
27 long vendorId; // idVendor from the device
28 long productId; // idProduct from the device
30 // Vendor and product names from an internal database.
31 DOMString? vendorName;
32 DOMString? productName;
34 // iManufacturer, iProduct and iSerial strings from the device.
35 DOMString? manufacturerString;
36 DOMString? productString;
37 DOMString? serialString;
40 callback GetDevicesCallback = void (long[] deviceIds);
41 callback GetDeviceInfoCallback = void (DeviceInfo deviceInfo);
43 interface Functions {
44 // Lists USB devices matching any of the given filters.
45 // |filters|: The properties to search for on target devices.
46 // |callback|: Invoked with a list of device IDs on complete.
47 static void getDevices(DeviceFilter[] filters,
48 GetDevicesCallback callback);
50 // Gets basic display information about a device.
51 // |deviceId|: The device ID (from |getDevices|).
52 // |callback|: Invoked with |DeviceInfo| from the device.
53 static void getDeviceInfo(long deviceId, GetDeviceInfoCallback callback);