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

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

Issue 1946063002: Replace DeviceManager::GetDeviceChanges with a client interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@proper_stubs
Patch Set: Rebase.d Created 4 years, 7 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/usb/public/interfaces/device_manager.mojom
diff --git a/device/usb/public/interfaces/device_manager.mojom b/device/usb/public/interfaces/device_manager.mojom
index fa8bb75c0954e2ccfbf6e3de17301de5a5250e67..dd0e0600857d52a9e183f941c41fb5a712a75f4d 100644
--- a/device/usb/public/interfaces/device_manager.mojom
+++ b/device/usb/public/interfaces/device_manager.mojom
@@ -27,21 +27,23 @@ struct EnumerationOptions {
array<DeviceFilter>? filters;
};
-struct DeviceChangeNotification {
- array<DeviceInfo> devices_added;
- array<DeviceInfo> devices_removed;
-};
-
interface DeviceManager {
// Retrieves information about all devices available to the DeviceManager
// implementation.
GetDevices(EnumerationOptions? options) => (array<DeviceInfo> results);
- // Retrieves information about changes to the set of devices available to the
- // DeviceManager since the last call to this method. A device that is added
- // and removed between calls will not be included.
- GetDeviceChanges() => (DeviceChangeNotification changes);
-
// Requests a device by guid.
GetDevice(string guid, Device& device_request);
+
+ // Sets the client for this DeviceManager service. The service will notify its
+ // client of device events such as connection and disconnection.
+ SetClient(DeviceManagerClient client);
+};
+
+interface DeviceManagerClient {
+ // Called when a device is connected to the host.
+ OnDeviceAdded(DeviceInfo device_info);
+
+ // Called when a device is disconnected from the host.
+ OnDeviceRemoved(DeviceInfo device_info);
};
« no previous file with comments | « device/usb/mojo/device_manager_impl_unittest.cc ('k') | third_party/WebKit/LayoutTests/usb/resources/usb-helpers.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698