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

Unified Diff: device/devices_app/usb/device_manager_impl.h

Issue 1342663003: Pass full Mojo USB DeviceInfo object with removal notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. 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
« no previous file with comments | « no previous file | device/devices_app/usb/device_manager_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/devices_app/usb/device_manager_impl.h
diff --git a/device/devices_app/usb/device_manager_impl.h b/device/devices_app/usb/device_manager_impl.h
index b84f2544e0cbd0c6188db3ac866209fe08565903..b8a65ceda0934fb2032723c0c6e2bb1c75dd5b2e 100644
--- a/device/devices_app/usb/device_manager_impl.h
+++ b/device/devices_app/usb/device_manager_impl.h
@@ -37,6 +37,9 @@ class DeviceManagerDelegate;
// requested from the devices app located at "mojo:devices", if available.
class DeviceManagerImpl : public DeviceManager {
public:
+ using DeviceList = std::vector<scoped_refptr<UsbDevice>>;
+ using DeviceMap = std::map<std::string, scoped_refptr<device::UsbDevice>>;
+
DeviceManagerImpl(
mojo::InterfaceRequest<DeviceManager> request,
PermissionProviderPtr permission_provider,
@@ -64,16 +67,17 @@ class DeviceManagerImpl : public DeviceManager {
mojo::Array<mojo::String> allowed_guids);
// Callbacks to handle the async responses from the underlying UsbService.
- void OnGetDevices(const GetDevicesCallback& callback,
- mojo::Array<DeviceInfoPtr> devices);
+ void OnGetDevices(EnumerationOptionsPtr options,
+ const GetDevicesCallback& callback,
+ const DeviceList& devices);
// Methods called by |helper_| when devices are added or removed.
- void OnDeviceAdded(DeviceInfoPtr device);
- void OnDeviceRemoved(std::string device_guid);
+ void OnDeviceAdded(scoped_refptr<device::UsbDevice> device);
+ void OnDeviceRemoved(scoped_refptr<device::UsbDevice> device);
void MaybeRunDeviceChangesCallback();
void OnEnumerationPermissionCheckComplete(
- mojo::Array<DeviceInfoPtr> devices_added,
- const std::set<std::string>& devices_removed,
+ const DeviceMap& devices_added,
+ const DeviceMap& devices_removed,
mojo::Array<mojo::String> allowed_guids);
PermissionProviderPtr permission_provider_;
@@ -84,8 +88,8 @@ class DeviceManagerImpl : public DeviceManager {
// are collected in |devices_added_| and |devices_removed_| until the
// next call to GetDeviceChanges.
std::queue<GetDeviceChangesCallback> device_change_callbacks_;
- mojo::Array<DeviceInfoPtr> devices_added_;
- std::set<std::string> devices_removed_;
+ DeviceMap devices_added_;
+ DeviceMap devices_removed_;
// To ensure that GetDeviceChangesCallbacks are called in the correct order
// only perform a single request to |permission_provider_| at a time.
bool permission_request_pending_ = false;
« no previous file with comments | « no previous file | device/devices_app/usb/device_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698