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

Side by Side Diff: chrome/browser/devtools/device/usb/usb_device_provider.h

Issue 287643002: DevTools: Partially redesigned DevToolsAndroidBridge and AndroidDeviceManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved Device::OpenSocket callback to HandlerThread Created 6 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 CHROME_BROWSER_DEVTOOLS_DEVICE_USB_USB_DEVICE_PROVIDER_H_ 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVICE_USB_USB_DEVICE_PROVIDER_H_
6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_USB_USB_DEVICE_PROVIDER_H_ 6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_USB_USB_DEVICE_PROVIDER_H_
7 7
8 #include "chrome/browser/devtools/device/android_device_manager.h" 8 #include "chrome/browser/devtools/device/android_device_manager.h"
9 9
10 namespace crypto { 10 namespace crypto {
11 class RSAPrivateKey; 11 class RSAPrivateKey;
12 } 12 }
13 13
14 class AndroidUsbDevice;
15
14 class UsbDeviceProvider : public AndroidDeviceManager::DeviceProvider { 16 class UsbDeviceProvider : public AndroidDeviceManager::DeviceProvider {
15 public: 17 public:
16 typedef DeviceProvider::QueryDevicesCallback QueryDevicesCallback;
17
18 static void CountDevices(const base::Callback<void(int)>& callback); 18 static void CountDevices(const base::Callback<void(int)>& callback);
19 19
20 explicit UsbDeviceProvider(Profile* profile); 20 explicit UsbDeviceProvider(Profile* profile);
21 21
22 virtual void QueryDevices(const QueryDevicesCallback& callback) OVERRIDE; 22 virtual void QueryDevices(const SerialsCallback& callback) OVERRIDE;
23
24 virtual void QueryDeviceInfo(const std::string& serial,
25 const DeviceInfoCallback& callback) OVERRIDE;
26
27 virtual void OpenSocket(const std::string& serial,
28 const std::string& socket_name,
29 const SocketCallback& callback) OVERRIDE;
30
31 virtual void ReleaseDevice(const std::string& serial) OVERRIDE;
23 32
24 private: 33 private:
25 virtual ~UsbDeviceProvider(); 34 virtual ~UsbDeviceProvider();
26 35
36 void EnumeratedDevices(
37 const SerialsCallback& callback,
38 const std::vector<scoped_refptr<AndroidUsbDevice> >& devices);
39
40 typedef std::map<std::string, scoped_refptr<AndroidUsbDevice> > UsbDeviceMap;
41
27 scoped_ptr<crypto::RSAPrivateKey> rsa_key_; 42 scoped_ptr<crypto::RSAPrivateKey> rsa_key_;
43 UsbDeviceMap device_map_;
28 }; 44 };
29 45
30 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_USB_USB_DEVICE_PROVIDER_H_ 46 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_USB_USB_DEVICE_PROVIDER_H_
OLDNEW
« no previous file with comments | « chrome/browser/devtools/device/self_device_provider.cc ('k') | chrome/browser/devtools/device/usb/usb_device_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698