| Index: chrome/browser/chrome_device_client.cc
|
| diff --git a/chrome/browser/chrome_device_client.cc b/chrome/browser/chrome_device_client.cc
|
| index 835a4c3a57782af555671849cdb89ca5fc3e9abd..d0a31a6be55cca62a82fe3e69328eb80177506a0 100644
|
| --- a/chrome/browser/chrome_device_client.cc
|
| +++ b/chrome/browser/chrome_device_client.cc
|
| @@ -5,11 +5,33 @@
|
| #include "chrome/browser/chrome_device_client.h"
|
|
|
| #include "base/logging.h"
|
| +#include "base/macros.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "device/hid/hid_service.h"
|
| +#include "device/usb/public/cpp/device_manager_delegate.h"
|
| +#include "device/usb/public/cpp/device_manager_factory.h"
|
| +#include "device/usb/public/interfaces/device.mojom.h"
|
| #include "device/usb/usb_service.h"
|
|
|
| using content::BrowserThread;
|
| +
|
| +namespace {
|
| +
|
| +// DeviceManagerDelegate implementation which allows access to all devices.
|
| +class BrowserDeviceManagerDelegate : public device::usb::DeviceManagerDelegate {
|
| + public:
|
| + BrowserDeviceManagerDelegate() {}
|
| + ~BrowserDeviceManagerDelegate() override {}
|
| +
|
| + private:
|
| + bool IsDeviceAllowed(const device::usb::DeviceInfo& device) override {
|
| + return true;
|
| + }
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(BrowserDeviceManagerDelegate);
|
| +};
|
| +
|
| +} // namespace
|
|
|
| ChromeDeviceClient::ChromeDeviceClient() {}
|
|
|
| @@ -21,6 +43,14 @@
|
| BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE));
|
| }
|
|
|
| +void ChromeDeviceClient::ConnectToUSBDeviceManager(
|
| + mojo::InterfaceRequest<device::usb::DeviceManager> request) {
|
| + device::usb::DeviceManagerFactory::Build(
|
| + request.Pass(),
|
| + scoped_ptr<device::usb::DeviceManagerDelegate>(
|
| + new BrowserDeviceManagerDelegate));
|
| +}
|
| +
|
| device::HidService* ChromeDeviceClient::GetHidService() {
|
| DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| return device::HidService::GetInstance(
|
|
|