| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef DEVICE_USB_MOJO_DEVICE_MANAGER_IMPL_H_ | 5 #ifndef DEVICE_USB_MOJO_DEVICE_MANAGER_IMPL_H_ |
| 6 #define DEVICE_USB_MOJO_DEVICE_MANAGER_IMPL_H_ | 6 #define DEVICE_USB_MOJO_DEVICE_MANAGER_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 ~DeviceManagerImpl() override; | 47 ~DeviceManagerImpl() override; |
| 48 | 48 |
| 49 void set_connection_error_handler(const base::Closure& error_handler) { | 49 void set_connection_error_handler(const base::Closure& error_handler) { |
| 50 connection_error_handler_ = error_handler; | 50 connection_error_handler_ = error_handler; |
| 51 } | 51 } |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 // DeviceManager implementation: | 54 // DeviceManager implementation: |
| 55 void GetDevices(EnumerationOptionsPtr options, | 55 void GetDevices(EnumerationOptionsPtr options, |
| 56 const GetDevicesCallback& callback) override; | 56 const GetDevicesCallback& callback) override; |
| 57 void GetDevice(const mojo::String& guid, | 57 void GetDevice(const std::string& guid, |
| 58 mojo::InterfaceRequest<Device> device_request) override; | 58 mojo::InterfaceRequest<Device> device_request) override; |
| 59 void SetClient(DeviceManagerClientPtr client) override; | 59 void SetClient(DeviceManagerClientPtr client) override; |
| 60 | 60 |
| 61 // Callbacks to handle the async responses from the underlying UsbService. | 61 // Callbacks to handle the async responses from the underlying UsbService. |
| 62 void OnGetDevices(EnumerationOptionsPtr options, | 62 void OnGetDevices(EnumerationOptionsPtr options, |
| 63 const GetDevicesCallback& callback, | 63 const GetDevicesCallback& callback, |
| 64 const std::vector<scoped_refptr<UsbDevice>>& devices); | 64 const std::vector<scoped_refptr<UsbDevice>>& devices); |
| 65 | 65 |
| 66 // UsbService::Observer implementation: | 66 // UsbService::Observer implementation: |
| 67 void OnDeviceAdded(scoped_refptr<UsbDevice> device) override; | 67 void OnDeviceAdded(scoped_refptr<UsbDevice> device) override; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 81 mojo::StrongBinding<DeviceManager> binding_; | 81 mojo::StrongBinding<DeviceManager> binding_; |
| 82 base::WeakPtrFactory<DeviceManagerImpl> weak_factory_; | 82 base::WeakPtrFactory<DeviceManagerImpl> weak_factory_; |
| 83 | 83 |
| 84 DISALLOW_COPY_AND_ASSIGN(DeviceManagerImpl); | 84 DISALLOW_COPY_AND_ASSIGN(DeviceManagerImpl); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 } // namespace usb | 87 } // namespace usb |
| 88 } // namespace device | 88 } // namespace device |
| 89 | 89 |
| 90 #endif // DEVICE_USB_MOJO_DEVICE_MANAGER_IMPL_H_ | 90 #endif // DEVICE_USB_MOJO_DEVICE_MANAGER_IMPL_H_ |
| OLD | NEW |