| 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.usb</code> API to interact with connected USB | 5 // Use the <code>chrome.usb</code> API to interact with connected USB |
| 6 // devices. This API provides access to USB operations from within the context | 6 // devices. This API provides access to USB operations from within the context |
| 7 // of an app. Using this API, apps can function as drivers for hardware devices. | 7 // of an app. 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 usb { | 12 [use_movable_types=true] namespace usb { |
| 13 | 13 |
| 14 // Direction, Recipient, RequestType, and TransferType all map to their | 14 // Direction, Recipient, RequestType, and TransferType all map to their |
| 15 // namesakes within the USB specification. | 15 // namesakes within the USB specification. |
| 16 enum Direction {in, out}; | 16 enum Direction {in, out}; |
| 17 enum Recipient {device, _interface, endpoint, other}; | 17 enum Recipient {device, _interface, endpoint, other}; |
| 18 enum RequestType {standard, class, vendor, reserved}; | 18 enum RequestType {standard, class, vendor, reserved}; |
| 19 enum TransferType {control, interrupt, isochronous, bulk}; | 19 enum TransferType {control, interrupt, isochronous, bulk}; |
| 20 | 20 |
| 21 // For isochronous mode, SynchronizationType and UsageType map to their | 21 // For isochronous mode, SynchronizationType and UsageType map to their |
| 22 // namesakes within the USB specification. | 22 // namesakes within the USB specification. |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 // device. Permission may have been granted at install time, when the user | 392 // device. Permission may have been granted at install time, when the user |
| 393 // accepted an optional permission (see $(ref:permissions.request)), or | 393 // accepted an optional permission (see $(ref:permissions.request)), or |
| 394 // through $(ref:getUserSelectedDevices). | 394 // through $(ref:getUserSelectedDevices). |
| 395 static void onDeviceAdded(Device device); | 395 static void onDeviceAdded(Device device); |
| 396 | 396 |
| 397 // Event generated when a device is removed from the system. See | 397 // Event generated when a device is removed from the system. See |
| 398 // $(ref:onDeviceAdded) for which events are delivered. | 398 // $(ref:onDeviceAdded) for which events are delivered. |
| 399 static void onDeviceRemoved(Device device); | 399 static void onDeviceRemoved(Device device); |
| 400 }; | 400 }; |
| 401 }; | 401 }; |
| OLD | NEW |