[Presentation API, Android] Implement basic messaging
[chromium-blink-merge.git] / chrome / browser / devtools / device / port_forwarding_controller.h
blobb4410e39fde6bffcee3937ce3da23f0946f09d2a
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVICE_PORT_FORWARDING_CONTROLLER_H_
6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_PORT_FORWARDING_CONTROLLER_H_
8 #include <map>
10 #include "base/prefs/pref_change_registrar.h"
11 #include "chrome/browser/devtools/device/devtools_android_bridge.h"
12 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
13 #include "components/keyed_service/core/keyed_service.h"
15 class PrefService;
16 class Profile;
18 class PortForwardingController {
19 public:
20 typedef DevToolsAndroidBridge::PortStatus PortStatus;
21 typedef DevToolsAndroidBridge::PortStatusMap PortStatusMap;
22 typedef DevToolsAndroidBridge::BrowserStatus BrowserStatus;
23 typedef DevToolsAndroidBridge::ForwardingStatus ForwardingStatus;
25 PortForwardingController(Profile* profile, DevToolsAndroidBridge* bridge);
27 virtual ~PortForwardingController();
29 ForwardingStatus DeviceListChanged(
30 const DevToolsAndroidBridge::RemoteDevices& devices);
32 private:
33 class Connection;
34 typedef std::map<std::string, Connection*> Registry;
36 void OnPrefsChange();
38 void UpdateConnections();
40 DevToolsAndroidBridge* bridge_;
41 PrefService* pref_service_;
42 PrefChangeRegistrar pref_change_registrar_;
43 Registry registry_;
45 typedef std::map<int, std::string> ForwardingMap;
46 ForwardingMap forwarding_map_;
48 DISALLOW_COPY_AND_ASSIGN(PortForwardingController);
51 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_PORT_FORWARDING_CONTROLLER_H_