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_ANDROID_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ |
6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ | 6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 void AddDeviceCountListener(DeviceCountListener* listener); | 235 void AddDeviceCountListener(DeviceCountListener* listener); |
236 void RemoveDeviceCountListener(DeviceCountListener* listener); | 236 void RemoveDeviceCountListener(DeviceCountListener* listener); |
237 | 237 |
238 void set_device_providers_for_test( | 238 void set_device_providers_for_test( |
239 const AndroidDeviceManager::DeviceProviders& device_providers) { | 239 const AndroidDeviceManager::DeviceProviders& device_providers) { |
240 device_providers_ = device_providers; | 240 device_providers_ = device_providers; |
241 } | 241 } |
242 | 242 |
243 static bool HasDevToolsWindow(const std::string& agent_id); | 243 static bool HasDevToolsWindow(const std::string& agent_id); |
244 | 244 |
| 245 void set_polling_interval_for_test(int value) { |
| 246 polling_interval_for_test_ = value; |
| 247 } |
| 248 |
245 private: | 249 private: |
246 friend struct content::BrowserThread::DeleteOnThread< | 250 friend struct content::BrowserThread::DeleteOnThread< |
247 content::BrowserThread::UI>; | 251 content::BrowserThread::UI>; |
248 friend class base::DeleteHelper<DevToolsAndroidBridge>; | 252 friend class base::DeleteHelper<DevToolsAndroidBridge>; |
249 | 253 |
250 class HandlerThread : public base::RefCountedThreadSafe<HandlerThread> { | 254 class HandlerThread : public base::RefCountedThreadSafe<HandlerThread> { |
251 public: | 255 public: |
252 static scoped_refptr<HandlerThread> GetInstance(); | 256 static scoped_refptr<HandlerThread> GetInstance(); |
253 base::MessageLoop* message_loop(); | 257 base::MessageLoop* message_loop(); |
254 | 258 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 scoped_refptr<AndroidDeviceManager> device_manager_; | 290 scoped_refptr<AndroidDeviceManager> device_manager_; |
287 | 291 |
288 typedef std::vector<DeviceListListener*> DeviceListListeners; | 292 typedef std::vector<DeviceListListener*> DeviceListListeners; |
289 DeviceListListeners device_list_listeners_; | 293 DeviceListListeners device_list_listeners_; |
290 | 294 |
291 typedef std::vector<DeviceCountListener*> DeviceCountListeners; | 295 typedef std::vector<DeviceCountListener*> DeviceCountListeners; |
292 DeviceCountListeners device_count_listeners_; | 296 DeviceCountListeners device_count_listeners_; |
293 | 297 |
294 AndroidDeviceManager::DeviceProviders device_providers_; | 298 AndroidDeviceManager::DeviceProviders device_providers_; |
295 PrefChangeRegistrar pref_change_registrar_; | 299 PrefChangeRegistrar pref_change_registrar_; |
| 300 |
| 301 int polling_interval_for_test_; |
296 DISALLOW_COPY_AND_ASSIGN(DevToolsAndroidBridge); | 302 DISALLOW_COPY_AND_ASSIGN(DevToolsAndroidBridge); |
297 }; | 303 }; |
298 | 304 |
299 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ | 305 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ |
OLD | NEW |