Index: chrome/browser/devtools/device/devtools_android_bridge.h |
diff --git a/chrome/browser/devtools/device/devtools_android_bridge.h b/chrome/browser/devtools/device/devtools_android_bridge.h |
index 6a0f781e8138db2e0c4df7204a4de1a33537ee0f..5d523a6e98a619a72fba9f31f5b06c8b63f4507e 100644 |
--- a/chrome/browser/devtools/device/devtools_android_bridge.h |
+++ b/chrome/browser/devtools/device/devtools_android_bridge.h |
@@ -9,6 +9,7 @@ |
#include <vector> |
#include "base/callback.h" |
+#include "base/cancelable_callback.h" |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/prefs/pref_change_registrar.h" |
@@ -39,6 +40,8 @@ class DevToolsAndroidBridge |
DevToolsAndroidBridge, |
content::BrowserThread::DeleteOnUIThread> { |
public: |
+ static const int kAdbPollingIntervalMs; |
+ |
typedef base::Callback<void(int result, |
const std::string& response)> Callback; |
@@ -242,6 +245,11 @@ class DevToolsAndroidBridge |
device_providers_ = device_providers; |
} |
+ void set_device_count_request_scheduler_for_test( |
+ base::Callback<void(base::Closure)> scheduler) { |
+ device_count_request_scheduler_for_test_ = scheduler; |
+ } |
+ |
static bool HasDevToolsWindow(const std::string& agent_id); |
private: |
@@ -277,9 +285,14 @@ class DevToolsAndroidBridge |
void CreatedDeviceManager(scoped_refptr<AndroidDeviceManager> device_manager); |
void RequestDeviceList(); |
void ReceivedDeviceList(RemoteDevices* devices); |
+ void StartDeviceListPollingLoop(); |
+ void StopDeviceListPollingLoop(); |
void RequestDeviceCount(); |
void ReceivedDeviceCount(int count); |
+ void StartDeviceCountPollingLoop(); |
+ void StopDeviceCountPollingLoop(); |
+ void ScheduleDeviceCountRequest(base::Closure callback); |
void CreateDeviceProviders(); |
@@ -289,12 +302,18 @@ class DevToolsAndroidBridge |
typedef std::vector<DeviceListListener*> DeviceListListeners; |
DeviceListListeners device_list_listeners_; |
+ base::CancelableCallback<void()> request_device_list_bound_; |
+ base::CancelableCallback<void(RemoteDevices* devices_ptr)> |
+ received_device_list_bound_; |
typedef std::vector<DeviceCountListener*> DeviceCountListeners; |
DeviceCountListeners device_count_listeners_; |
+ base::CancelableCallback<void()> request_device_count_bound_; |
+ base::CancelableCallback<void(int)> received_device_count_bound_; |
AndroidDeviceManager::DeviceProviders device_providers_; |
PrefChangeRegistrar pref_change_registrar_; |
+ base::Callback<void(base::Closure)> device_count_request_scheduler_for_test_; |
DISALLOW_COPY_AND_ASSIGN(DevToolsAndroidBridge); |
}; |