Commit aea9d395 authored by tbarzic's avatar tbarzic Committed by Commit bot

Enable USB device permission for interface class for stable

BUG=629223

Review-Url: https://codereview.chromium.org/2614663005
Cr-Commit-Position: refs/heads/master@{#443504}
parent 0562259b
......@@ -42,8 +42,8 @@ Chrome Apps can also connect to <a href="serial">serial</a> and
</p>
<p>
You must declare the VID/PID pairs for each type of device you want to use
under the "usbDevices" permission in your app's manifest file, as shown in the
example below:</p>
under the <code>usbDevices</code> permission in your app's manifest file, as
shown in the example below:</p>
<pre data-filename="manifest.json">
"permissions": [
......@@ -61,6 +61,56 @@ Chrome Apps can also connect to <a href="serial">serial</a> and
<p class="note">Note that only decimal numbers are allowed in JSON format.
You cannot use hexadecimal numbers in these fields.</p>
<p>Since <b>Chrome 57</b>, the requirement for declaring all the device types
in the app manifest is relaxed for apps running as Chrome OS
<a href="apps/manifest/kiosk_enabled">kiosk apps</a>.
For kiosk apps, you can use the <code>interfaceClass</code> permission
property to request permission to access USB devices that:
<ul>
<li>implement a USB interface of a specific interface class</li>
<li>have a specific USB device class</li>
</ul>
For example, the following <code>usbDevices</code> permission would grant an
app access to all USB devices that implement a printer interface (interface
class code 7), and to USB hub devices (device class code 9):</p>
<pre data-filename="manifest.json">
"permissions": [
{
"usbDevices": [
{"interfaceClass": 7},
{"interfaceClass": 9}
]
}
]
</pre>
<p>For the list of acceptable <code>interfaceClass</code> values, see
<a href="http://www.usb.org/developers/defined_class">USB Class Codes</a>.
</p>
<p>The <code>interfaceClass</code> property can be combined with the
<code>vendorId</code> property to get access only to USB devices from a
specific vendor, as demonstrated by the following example:</p>
<pre data-filename="manifest.json">
"permissions": [
{
"usbDevices": [
{
"vendorId": 123,
"interfaceClass": 7
}
]
}
]
</pre>
<p class="note">Note that <code>usbDevices</code> permissions with
<code>interfaceClass</code> property have effect only when the app is running
in kiosk session - outside a kiosk session these permissions will be ignored.
</p>
<h2 id="finding_device">Finding a device</h2>
<p>
......
......@@ -43,7 +43,7 @@
]
},
"allow_usb_devices_permission_interface_class": {
"channel": "dev",
"channel": "stable",
"extension_types": ["platform_app"],
"session_types": ["kiosk"]
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment