1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVICE_USB_USB_DEVICE_PROVIDER_H_
6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_USB_USB_DEVICE_PROVIDER_H_
8 #include "chrome/browser/devtools/device/android_device_manager.h"
14 class AndroidUsbDevice
;
16 class UsbDeviceProvider
: public AndroidDeviceManager::DeviceProvider
{
18 static void CountDevices(const base::Callback
<void(int)>& callback
);
20 explicit UsbDeviceProvider(Profile
* profile
);
22 void QueryDevices(const SerialsCallback
& callback
) override
;
24 void QueryDeviceInfo(const std::string
& serial
,
25 const DeviceInfoCallback
& callback
) override
;
27 void OpenSocket(const std::string
& serial
,
28 const std::string
& socket_name
,
29 const SocketCallback
& callback
) override
;
31 void ReleaseDevice(const std::string
& serial
) override
;
34 ~UsbDeviceProvider() override
;
36 void EnumeratedDevices(
37 const SerialsCallback
& callback
,
38 const std::vector
<scoped_refptr
<AndroidUsbDevice
> >& devices
);
40 typedef std::map
<std::string
, scoped_refptr
<AndroidUsbDevice
> > UsbDeviceMap
;
42 scoped_ptr
<crypto::RSAPrivateKey
> rsa_key_
;
43 UsbDeviceMap device_map_
;
46 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_USB_USB_DEVICE_PROVIDER_H_