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 19 matching lines...) Expand all Loading... |
30 class Thread; | 30 class Thread; |
31 } // namespace base | 31 } // namespace base |
32 | 32 |
33 namespace content { | 33 namespace content { |
34 class BrowserContext; | 34 class BrowserContext; |
35 } | 35 } |
36 | 36 |
37 class DevToolsTargetImpl; | 37 class DevToolsTargetImpl; |
38 class PortForwardingController; | 38 class PortForwardingController; |
39 class Profile; | 39 class Profile; |
40 class WebRTCDeviceProvider; | |
41 class SigninManagerBase; | |
42 class ProfileOAuth2TokenService; | |
43 | 40 |
44 class DevToolsAndroidBridge : public KeyedService { | 41 class DevToolsAndroidBridge : public KeyedService { |
45 public: | 42 public: |
46 class Factory : public BrowserContextKeyedServiceFactory { | 43 class Factory : public BrowserContextKeyedServiceFactory { |
47 public: | 44 public: |
48 // Returns singleton instance of DevToolsAndroidBridge. | 45 // Returns singleton instance of DevToolsAndroidBridge. |
49 static Factory* GetInstance(); | 46 static Factory* GetInstance(); |
50 | 47 |
51 // Returns DevToolsAndroidBridge associated with |profile|. | 48 // Returns DevToolsAndroidBridge associated with |profile|. |
52 static DevToolsAndroidBridge* GetForProfile(Profile* profile); | 49 static DevToolsAndroidBridge* GetForProfile(Profile* profile); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 150 |
154 typedef std::vector<scoped_refptr<RemoteDevice> > RemoteDevices; | 151 typedef std::vector<scoped_refptr<RemoteDevice> > RemoteDevices; |
155 | 152 |
156 class DeviceListListener { | 153 class DeviceListListener { |
157 public: | 154 public: |
158 virtual void DeviceListChanged(const RemoteDevices& devices) = 0; | 155 virtual void DeviceListChanged(const RemoteDevices& devices) = 0; |
159 protected: | 156 protected: |
160 virtual ~DeviceListListener() {} | 157 virtual ~DeviceListListener() {} |
161 }; | 158 }; |
162 | 159 |
163 DevToolsAndroidBridge(Profile* profile, | 160 explicit DevToolsAndroidBridge(Profile* profile); |
164 SigninManagerBase* signin_manager, | |
165 ProfileOAuth2TokenService* token_service); | |
166 void AddDeviceListListener(DeviceListListener* listener); | 161 void AddDeviceListListener(DeviceListListener* listener); |
167 void RemoveDeviceListListener(DeviceListListener* listener); | 162 void RemoveDeviceListListener(DeviceListListener* listener); |
168 | 163 |
169 class DeviceCountListener { | 164 class DeviceCountListener { |
170 public: | 165 public: |
171 virtual void DeviceCountChanged(int count) = 0; | 166 virtual void DeviceCountChanged(int count) = 0; |
172 protected: | 167 protected: |
173 virtual ~DeviceCountListener() {} | 168 virtual ~DeviceCountListener() {} |
174 }; | 169 }; |
175 | 170 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 const base::Closure callback); | 262 const base::Closure callback); |
268 | 263 |
269 scoped_refptr<AndroidDeviceManager::Device> FindDevice( | 264 scoped_refptr<AndroidDeviceManager::Device> FindDevice( |
270 const std::string& serial); | 265 const std::string& serial); |
271 | 266 |
272 base::WeakPtr<DevToolsAndroidBridge> AsWeakPtr() { | 267 base::WeakPtr<DevToolsAndroidBridge> AsWeakPtr() { |
273 return weak_factory_.GetWeakPtr(); | 268 return weak_factory_.GetWeakPtr(); |
274 } | 269 } |
275 | 270 |
276 Profile* const profile_; | 271 Profile* const profile_; |
277 SigninManagerBase* const signin_manager_; | |
278 ProfileOAuth2TokenService* const token_service_; | |
279 const scoped_ptr<AndroidDeviceManager> device_manager_; | 272 const scoped_ptr<AndroidDeviceManager> device_manager_; |
280 | 273 |
281 typedef std::map<std::string, scoped_refptr<AndroidDeviceManager::Device>> | 274 typedef std::map<std::string, scoped_refptr<AndroidDeviceManager::Device>> |
282 DeviceMap; | 275 DeviceMap; |
283 DeviceMap device_map_; | 276 DeviceMap device_map_; |
284 | 277 |
285 typedef std::map<std::string, AgentHostDelegate*> AgentHostDelegates; | 278 typedef std::map<std::string, AgentHostDelegate*> AgentHostDelegates; |
286 AgentHostDelegates host_delegates_; | 279 AgentHostDelegates host_delegates_; |
287 | 280 |
288 typedef std::vector<DeviceListListener*> DeviceListListeners; | 281 typedef std::vector<DeviceListListener*> DeviceListListeners; |
(...skipping 10 matching lines...) Expand all Loading... |
299 scoped_ptr<PortForwardingController> port_forwarding_controller_; | 292 scoped_ptr<PortForwardingController> port_forwarding_controller_; |
300 | 293 |
301 PrefChangeRegistrar pref_change_registrar_; | 294 PrefChangeRegistrar pref_change_registrar_; |
302 | 295 |
303 base::WeakPtrFactory<DevToolsAndroidBridge> weak_factory_; | 296 base::WeakPtrFactory<DevToolsAndroidBridge> weak_factory_; |
304 | 297 |
305 DISALLOW_COPY_AND_ASSIGN(DevToolsAndroidBridge); | 298 DISALLOW_COPY_AND_ASSIGN(DevToolsAndroidBridge); |
306 }; | 299 }; |
307 | 300 |
308 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ | 301 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ |
OLD | NEW |