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

Side by Side Diff: chrome/browser/devtools/device/devtools_android_bridge.h

Issue 2253683002: [DevTools] Introduce a target discovery preference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test added Created 4 years, 4 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 unified diff | Download patch
OLDNEW
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 <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 19 matching lines...) Expand all
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 TCPDeviceProvider;
40 41
41 class DevToolsAndroidBridge : public KeyedService { 42 class DevToolsAndroidBridge : public KeyedService {
42 public: 43 public:
43 class Factory : public BrowserContextKeyedServiceFactory { 44 class Factory : public BrowserContextKeyedServiceFactory {
44 public: 45 public:
45 // Returns singleton instance of DevToolsAndroidBridge. 46 // Returns singleton instance of DevToolsAndroidBridge.
46 static Factory* GetInstance(); 47 static Factory* GetInstance();
47 48
48 // Returns DevToolsAndroidBridge associated with |profile|. 49 // Returns DevToolsAndroidBridge associated with |profile|.
49 static DevToolsAndroidBridge* GetForProfile(Profile* profile); 50 static DevToolsAndroidBridge* GetForProfile(Profile* profile);
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 void OpenRemotePage(scoped_refptr<RemoteBrowser> browser, 211 void OpenRemotePage(scoped_refptr<RemoteBrowser> browser,
211 const std::string& url); 212 const std::string& url);
212 213
213 scoped_refptr<content::DevToolsAgentHost> GetBrowserAgentHost( 214 scoped_refptr<content::DevToolsAgentHost> GetBrowserAgentHost(
214 scoped_refptr<RemoteBrowser> browser); 215 scoped_refptr<RemoteBrowser> browser);
215 216
216 void SendJsonRequest(const std::string& browser_id_str, 217 void SendJsonRequest(const std::string& browser_id_str,
217 const std::string& url, 218 const std::string& url,
218 const JsonRequestCallback& callback); 219 const JsonRequestCallback& callback);
219 220
221 typedef base::Callback<void(scoped_refptr<TCPDeviceProvider>)>
dgozman 2016/08/17 00:22:19 typedef -> using
eostroukhov-old 2016/08/17 00:44:22 Did it for all typedefs in this file.
222 tcp_provider_callback;
dgozman 2016/08/17 00:22:19 Types are TitleCase.
eostroukhov-old 2016/08/17 00:44:22 Done.
223 void set_tcp_provider_callback_for_test(tcp_provider_callback callback) {
dgozman 2016/08/17 00:22:19 Move function definition to cc.
eostroukhov-old 2016/08/17 00:44:22 Done.
224 tcp_provider_callback_ = callback;
225 CreateDeviceProviders();
226 }
227
220 private: 228 private:
221 friend struct content::BrowserThread::DeleteOnThread< 229 friend struct content::BrowserThread::DeleteOnThread<
222 content::BrowserThread::UI>; 230 content::BrowserThread::UI>;
223 friend class base::DeleteHelper<DevToolsAndroidBridge>; 231 friend class base::DeleteHelper<DevToolsAndroidBridge>;
224 232
225 friend class PortForwardingController; 233 friend class PortForwardingController;
226 234
227 class AgentHostDelegate; 235 class AgentHostDelegate;
228 class DiscoveryRequest; 236 class DiscoveryRequest;
229 class RemotePageTarget; 237 class RemotePageTarget;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 DeviceCountListeners device_count_listeners_; 294 DeviceCountListeners device_count_listeners_;
287 base::CancelableCallback<void(int)> device_count_callback_; 295 base::CancelableCallback<void(int)> device_count_callback_;
288 base::Callback<void(const base::Closure&)> task_scheduler_; 296 base::Callback<void(const base::Closure&)> task_scheduler_;
289 297
290 typedef std::vector<PortForwardingListener*> PortForwardingListeners; 298 typedef std::vector<PortForwardingListener*> PortForwardingListeners;
291 PortForwardingListeners port_forwarding_listeners_; 299 PortForwardingListeners port_forwarding_listeners_;
292 std::unique_ptr<PortForwardingController> port_forwarding_controller_; 300 std::unique_ptr<PortForwardingController> port_forwarding_controller_;
293 301
294 PrefChangeRegistrar pref_change_registrar_; 302 PrefChangeRegistrar pref_change_registrar_;
295 303
304 tcp_provider_callback tcp_provider_callback_;
305
296 base::WeakPtrFactory<DevToolsAndroidBridge> weak_factory_; 306 base::WeakPtrFactory<DevToolsAndroidBridge> weak_factory_;
297 307
298 DISALLOW_COPY_AND_ASSIGN(DevToolsAndroidBridge); 308 DISALLOW_COPY_AND_ASSIGN(DevToolsAndroidBridge);
299 }; 309 };
300 310
301 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_ 311 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_DEVTOOLS_ANDROID_BRIDGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698