Index: device/devices_app/usb/device_manager_impl.h |
diff --git a/device/usb/device_manager_impl.h b/device/devices_app/usb/device_manager_impl.h |
similarity index 67% |
rename from device/usb/device_manager_impl.h |
rename to device/devices_app/usb/device_manager_impl.h |
index 5c77a65b39d09cbda941a36066528ca2570fd5e0..5b0fb045ae93ae44573ace787c5208536bc02fcf 100644 |
--- a/device/usb/device_manager_impl.h |
+++ b/device/devices_app/usb/device_manager_impl.h |
@@ -11,10 +11,18 @@ |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/memory/weak_ptr.h" |
-#include "device/usb/public/interfaces/device_manager.mojom.h" |
+#include "device/devices_app/usb/public/interfaces/device_manager.mojom.h" |
#include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h" |
#include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" |
+namespace base { |
+class SequencedTaskRunner; |
+} |
+ |
+namespace mojo { |
+class ErrorHandler; |
+} |
+ |
namespace device { |
class UsbDevice; |
@@ -25,14 +33,18 @@ namespace usb { |
class DeviceManagerDelegate; |
-// Implementation of the public DeviceManager interface. Clients in the browser |
-// can connect to this service via DeviceClient::ConnectToUSBDeviceManager. |
+// Implementation of the public DeviceManager interface. This interface can be |
+// requested from the devices app located at "system:devices", if available. |
class DeviceManagerImpl : public DeviceManager { |
public: |
- DeviceManagerImpl(mojo::InterfaceRequest<DeviceManager> request, |
- scoped_ptr<DeviceManagerDelegate> delegate); |
+ DeviceManagerImpl( |
+ mojo::InterfaceRequest<DeviceManager> request, |
+ scoped_ptr<DeviceManagerDelegate> delegate, |
+ scoped_refptr<base::SequencedTaskRunner> service_task_runner); |
~DeviceManagerImpl() override; |
+ void set_error_handler(mojo::ErrorHandler* error_handler); |
+ |
private: |
// DeviceManager implementation: |
void GetDevices(EnumerationOptionsPtr options, |
@@ -42,18 +54,14 @@ class DeviceManagerImpl : public DeviceManager { |
const OpenDeviceCallback& callback) override; |
// Callback to handle the async response from the underlying UsbService. |
- void OnGetDevices(const GetDevicesCallback& callback, |
- const std::vector<UsbDeviceFilter>& filters, |
+ void OnGetDevices(EnumerationOptionsPtr options, |
+ const GetDevicesCallback& callback, |
const std::vector<scoped_refptr<UsbDevice>>& devices); |
- // Callback to handle the async Open response from a UsbDevice. |
- void OnOpenDevice(const OpenDeviceCallback& callback, |
- mojo::InterfaceRequest<Device> device_request, |
- scoped_refptr<UsbDeviceHandle> device_handle); |
- |
mojo::StrongBinding<DeviceManager> binding_; |
scoped_ptr<DeviceManagerDelegate> delegate_; |
+ scoped_refptr<base::SequencedTaskRunner> service_task_runner_; |
base::WeakPtrFactory<DeviceManagerImpl> weak_factory_; |