| OLD | NEW |
| 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_DEVTOOLS_DEVICE_DISCOVERY_H_ | 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_DEVICE_DISCOVERY_H_ |
| 6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_DEVICE_DISCOVERY_H_ | 6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_DEVICE_DISCOVERY_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 using CompleteDevices = std::vector<CompleteDevice>; | 116 using CompleteDevices = std::vector<CompleteDevice>; |
| 117 using DeviceListCallback = base::Callback<void(const CompleteDevices&)>; | 117 using DeviceListCallback = base::Callback<void(const CompleteDevices&)>; |
| 118 | 118 |
| 119 DevToolsDeviceDiscovery( | 119 DevToolsDeviceDiscovery( |
| 120 AndroidDeviceManager* device_manager, | 120 AndroidDeviceManager* device_manager, |
| 121 const DeviceListCallback& callback); | 121 const DeviceListCallback& callback); |
| 122 ~DevToolsDeviceDiscovery(); | 122 ~DevToolsDeviceDiscovery(); |
| 123 | 123 |
| 124 void SetScheduler(base::Callback<void(const base::Closure&)> scheduler); | 124 void SetScheduler(base::Callback<void(const base::Closure&)> scheduler); |
| 125 | 125 |
| 126 static void DiscoverOnce( | |
| 127 AndroidDeviceManager* device_manager, | |
| 128 const DeviceListCallback& callback); | |
| 129 static scoped_refptr<content::DevToolsAgentHost> CreateBrowserAgentHost( | 126 static scoped_refptr<content::DevToolsAgentHost> CreateBrowserAgentHost( |
| 130 scoped_refptr<AndroidDeviceManager::Device> device, | 127 scoped_refptr<AndroidDeviceManager::Device> device, |
| 131 scoped_refptr<RemoteBrowser> browser); | 128 scoped_refptr<RemoteBrowser> browser); |
| 132 | 129 |
| 133 private: | 130 private: |
| 134 class DiscoveryRequest; | 131 class DiscoveryRequest; |
| 135 | 132 |
| 136 void RequestDeviceList(); | 133 void RequestDeviceList(); |
| 137 void ReceivedDeviceList(const CompleteDevices& complete_devices); | 134 void ReceivedDeviceList(const CompleteDevices& complete_devices); |
| 138 | 135 |
| 139 AndroidDeviceManager* device_manager_; | 136 AndroidDeviceManager* device_manager_; |
| 140 const DeviceListCallback callback_; | 137 const DeviceListCallback callback_; |
| 141 base::Callback<void(const base::Closure&)> task_scheduler_; | 138 base::Callback<void(const base::Closure&)> task_scheduler_; |
| 142 base::WeakPtrFactory<DevToolsDeviceDiscovery> weak_factory_; | 139 base::WeakPtrFactory<DevToolsDeviceDiscovery> weak_factory_; |
| 143 | 140 |
| 144 DISALLOW_COPY_AND_ASSIGN(DevToolsDeviceDiscovery); | 141 DISALLOW_COPY_AND_ASSIGN(DevToolsDeviceDiscovery); |
| 145 }; | 142 }; |
| 146 | 143 |
| 147 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_DEVICE_DISCOVERY_H_ | 144 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_DEVICE_DISCOVERY_H_ |
| OLD | NEW |