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

Unified Diff: chrome/browser/devtools/device/devtools_android_bridge.h

Issue 500373004: DevTools: Make port forwarding part of DevToolsAndroidBridge. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed. Rebased Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/devtools/device/devtools_android_bridge.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ddc34bbfb4750b5b131925c7832e2ecfe8256185..651d1aa87f13b6b842cb7763998c8b3da5a510a1 100644
--- a/chrome/browser/devtools/device/devtools_android_bridge.h
+++ b/chrome/browser/devtools/device/devtools_android_bridge.h
@@ -33,6 +33,7 @@ class BrowserContext;
}
class DevToolsTargetImpl;
+class PortForwardingController;
class Profile;
class DevToolsAndroidBridge
@@ -208,6 +209,23 @@ class DevToolsAndroidBridge
void AddDeviceCountListener(DeviceCountListener* listener);
void RemoveDeviceCountListener(DeviceCountListener* listener);
+ typedef int PortStatus;
+ typedef std::map<int, PortStatus> PortStatusMap;
+ typedef std::map<std::string, PortStatusMap> DevicesStatus;
+
+ class PortForwardingListener {
+ public:
+ typedef DevToolsAndroidBridge::PortStatusMap PortStatusMap;
+ typedef DevToolsAndroidBridge::DevicesStatus DevicesStatus;
+
+ virtual void PortStatusChanged(const DevicesStatus&) = 0;
+ protected:
+ virtual ~PortForwardingListener() {}
+ };
+
+ void AddPortForwardingListener(PortForwardingListener* listener);
+ void RemovePortForwardingListener(PortForwardingListener* listener);
+
void set_device_providers_for_test(
const AndroidDeviceManager::DeviceProviders& device_providers) {
device_manager_->SetDeviceProviders(device_providers);
@@ -229,6 +247,7 @@ class DevToolsAndroidBridge
void StartDeviceListPolling();
void StopDeviceListPolling();
+ bool NeedsDeviceListPolling();
void RequestDeviceList(
const base::Callback<void(const RemoteDevices&)>& callback);
void ReceivedDeviceList(const RemoteDevices& devices);
@@ -254,6 +273,10 @@ class DevToolsAndroidBridge
base::CancelableCallback<void(int)> device_count_callback_;
base::Callback<void(const base::Closure&)> task_scheduler_;
+ typedef std::vector<PortForwardingListener*> PortForwardingListeners;
+ PortForwardingListeners port_forwarding_listeners_;
+ scoped_ptr<PortForwardingController> port_forwarding_controller_;
+
PrefChangeRegistrar pref_change_registrar_;
DISALLOW_COPY_AND_ASSIGN(DevToolsAndroidBridge);
};
« no previous file with comments | « no previous file | chrome/browser/devtools/device/devtools_android_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698