Chromium Code Reviews| Index: chrome/common/extensions/docs/templates/articles/app_usb.html |
| diff --git a/chrome/common/extensions/docs/templates/articles/app_usb.html b/chrome/common/extensions/docs/templates/articles/app_usb.html |
| index 3a1e9d35b15b0783d3381abb7e3a82849067eb2b..47804d607f4fd2278a4eb6124d00e72186b4893a 100644 |
| --- a/chrome/common/extensions/docs/templates/articles/app_usb.html |
| +++ b/chrome/common/extensions/docs/templates/articles/app_usb.html |
| @@ -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>, requirement for declaring all the device types |
|
Devlin
2017/01/10 15:56:50
*the* requirement
tbarzic
2017/01/10 17:42:25
Done.
|
| + 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 <code>interfaceClass</code> permission property to |
|
Devlin
2017/01/10 15:56:50
*the* <code>interfaceClass....
tbarzic
2017/01/10 17:42:25
Done.
|
| + declare permission to access USB devices that: |
|
Devlin
2017/01/10 15:56:50
s/declare/request?
tbarzic
2017/01/10 17:42:25
Done.
|
| + <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 list of acceptable <code>interfaceClass</code> values, see |
|
Devlin
2017/01/10 15:56:50
*the* list
tbarzic
2017/01/10 17:42:25
Done.
|
| + <a href="http://www.usb.org/developers/defined_class">USB Class Codes</a>. |
| + </p> |
| + |
| +<p><code>interfaceClass</code> property can be combined with |
| + <code>vendorId</code> property to get access only to USB devices of 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 said permissions will be ignored. |
|
Devlin
2017/01/10 15:56:50
s/said/these
tbarzic
2017/01/10 17:42:25
Done.
|
| + </p> |
| + |
| <h2 id="finding_device">Finding a device</h2> |
| <p> |