Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: device/devices_app/usb/public/interfaces/device.mojom

Issue 1352683006: Move device opening from DeviceManager to Device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/devices_app/usb/public/interfaces/device.mojom
diff --git a/device/devices_app/usb/public/interfaces/device.mojom b/device/devices_app/usb/public/interfaces/device.mojom
index 9c24c078a58b3540bbcbbb534c9e62ad5e1beaf3..a5e2905ed32948adef105abde36bb0c263c03259 100644
--- a/device/devices_app/usb/public/interfaces/device.mojom
+++ b/device/devices_app/usb/public/interfaces/device.mojom
@@ -4,6 +4,14 @@
module device.usb;
+enum OpenDeviceError {
+ // Opening the device succeeded.
+ OK,
+
+ // The operating system denied access to the device.
+ ACCESS_DENIED,
+};
+
enum TransferDirection {
IN,
OUT,
@@ -129,14 +137,20 @@ enum TransferStatus {
};
interface Device {
- // Closes the device. Calling this effectively invalidates the Device object.
- Close() => ();
-
// Retrieve a DeviceInfo struct containing metadata about the device,
- // including the set of all available device configurations. May return null
- // if the device has been closed.
+ // including the set of all available device configurations.
GetDeviceInfo() => (DeviceInfo? info);
+ // Retrieves the device's currently active configuration. May return null if
+ // the device is unconfigured.
+ GetConfiguration() => (ConfigurationInfo? info);
+
+ // Opens the device. Methods below require the device be opened first.
+ Open() => (OpenDeviceError error);
+
+ // Closes the device.
+ Close() => ();
+
// Initiates a device control transfer to set the device's configuration to
// one with the configuration value |value|.
SetConfiguration(uint8 value) => (bool success);
« no previous file with comments | « device/devices_app/usb/device_manager_impl_unittest.cc ('k') | device/devices_app/usb/public/interfaces/device_manager.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698