OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Use the <code>chrome.hid</code> API to interact with connected HID devices. | 5 // Use the <code>chrome.hid</code> API to interact with connected HID devices. |
6 // This API provides access to HID operations from within the context of an app. | 6 // This API provides access to HID operations from within the context of an app. |
7 // Using this API, apps can function as drivers for hardware devices. | 7 // Using this API, apps can function as drivers for hardware devices. |
8 // | 8 // |
9 // Errors generated by this API are reported by setting | 9 // Errors generated by this API are reported by setting |
10 // $(ref:runtime.lastError) and executing the function's regular callback. The | 10 // $(ref:runtime.lastError) and executing the function's regular callback. The |
11 // callback's regular parameters will be undefined in this case. | 11 // callback's regular parameters will be undefined in this case. |
12 namespace hid { | 12 [use_movable_types=true] namespace hid { |
13 dictionary HidCollectionInfo { | 13 dictionary HidCollectionInfo { |
14 // HID usage page identifier. | 14 // HID usage page identifier. |
15 long usagePage; | 15 long usagePage; |
16 // Page-defined usage identifier. | 16 // Page-defined usage identifier. |
17 long usage; | 17 long usage; |
18 // Report IDs which belong to the collection and to its children. | 18 // Report IDs which belong to the collection and to its children. |
19 long[] reportIds; | 19 long[] reportIds; |
20 }; | 20 }; |
21 | 21 |
22 [noinline_doc] dictionary HidDeviceInfo { | 22 [noinline_doc] dictionary HidDeviceInfo { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // accepted an optional permission (see $(ref:permissions.request)). | 162 // accepted an optional permission (see $(ref:permissions.request)). |
163 static void onDeviceAdded(HidDeviceInfo device); | 163 static void onDeviceAdded(HidDeviceInfo device); |
164 | 164 |
165 // Event generated when a device is removed from the system. See | 165 // Event generated when a device is removed from the system. See |
166 // $(ref:onDeviceAdded) for which events are delivered. | 166 // $(ref:onDeviceAdded) for which events are delivered. |
167 // |deviceId|: The <code>deviceId</code> property of the device passed to | 167 // |deviceId|: The <code>deviceId</code> property of the device passed to |
168 // $(ref:onDeviceAdded). | 168 // $(ref:onDeviceAdded). |
169 static void onDeviceRemoved(long deviceId); | 169 static void onDeviceRemoved(long deviceId); |
170 }; | 170 }; |
171 }; | 171 }; |
OLD | NEW |