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

Unified 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: Comments were addressed. 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 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 e716b33a4638ff44ef64fbe8876c3967d47a3a90..6bd55e3fd99969bb308af0e8bd9f0e3e3febb034 100644
--- a/chrome/browser/devtools/device/devtools_android_bridge.h
+++ b/chrome/browser/devtools/device/devtools_android_bridge.h
@@ -37,6 +37,7 @@ class BrowserContext;
class DevToolsTargetImpl;
class PortForwardingController;
class Profile;
+class TCPDeviceProvider;
class DevToolsAndroidBridge : public KeyedService {
public:
@@ -60,7 +61,7 @@ class DevToolsAndroidBridge : public KeyedService {
DISALLOW_COPY_AND_ASSIGN(Factory);
};
- typedef std::pair<std::string, std::string> BrowserId;
+ using BrowserId = std::pair<std::string, std::string>;
class RemotePage : public base::RefCounted<RemotePage> {
public:
@@ -83,8 +84,8 @@ class DevToolsAndroidBridge : public KeyedService {
DISALLOW_COPY_AND_ASSIGN(RemotePage);
};
- typedef std::vector<scoped_refptr<RemotePage> > RemotePages;
- typedef base::Callback<void(int, const std::string&)> JsonRequestCallback;
+ using RemotePages = std::vector<scoped_refptr<RemotePage> >;
+ using JsonRequestCallback = base::Callback<void(int, const std::string&)>;
class RemoteBrowser : public base::RefCounted<RemoteBrowser> {
public:
@@ -98,7 +99,7 @@ class DevToolsAndroidBridge : public KeyedService {
bool IsChrome();
std::string GetId();
- typedef std::vector<int> ParsedVersion;
+ using ParsedVersion = std::vector<int>;
ParsedVersion GetParsedVersion();
private:
@@ -120,7 +121,7 @@ class DevToolsAndroidBridge : public KeyedService {
DISALLOW_COPY_AND_ASSIGN(RemoteBrowser);
};
- typedef std::vector<scoped_refptr<RemoteBrowser> > RemoteBrowsers;
+ using RemoteBrowsers = std::vector<scoped_refptr<RemoteBrowser> >;
class RemoteDevice : public base::RefCounted<RemoteDevice> {
public:
@@ -148,7 +149,7 @@ class DevToolsAndroidBridge : public KeyedService {
DISALLOW_COPY_AND_ASSIGN(RemoteDevice);
};
- typedef std::vector<scoped_refptr<RemoteDevice> > RemoteDevices;
+ using RemoteDevices = std::vector<scoped_refptr<RemoteDevice> >;
class DeviceListListener {
public:
@@ -171,17 +172,16 @@ class DevToolsAndroidBridge : public KeyedService {
void AddDeviceCountListener(DeviceCountListener* listener);
void RemoveDeviceCountListener(DeviceCountListener* listener);
- typedef int PortStatus;
- typedef std::map<int, PortStatus> PortStatusMap;
- typedef std::pair<scoped_refptr<RemoteBrowser>, PortStatusMap>
- BrowserStatus;
- typedef std::vector<BrowserStatus> ForwardingStatus;
+ using PortStatus = int;
+ using PortStatusMap = std::map<int, PortStatus>;
+ using BrowserStatus = std::pair<scoped_refptr<RemoteBrowser>, PortStatusMap>;
+ using ForwardingStatus = std::vector<BrowserStatus>;
class PortForwardingListener {
public:
- typedef DevToolsAndroidBridge::PortStatusMap PortStatusMap;
- typedef DevToolsAndroidBridge::BrowserStatus BrowserStatus;
- typedef DevToolsAndroidBridge::ForwardingStatus ForwardingStatus;
+ using PortStatusMap = DevToolsAndroidBridge::PortStatusMap;
+ using BrowserStatus = DevToolsAndroidBridge::BrowserStatus;
+ using ForwardingStatus = DevToolsAndroidBridge::ForwardingStatus;
virtual void PortStatusChanged(const ForwardingStatus&) = 0;
protected:
@@ -206,7 +206,7 @@ class DevToolsAndroidBridge : public KeyedService {
// Creates new target instance owned by caller.
DevToolsTargetImpl* CreatePageTarget(scoped_refptr<RemotePage> browser);
- typedef base::Callback<void(scoped_refptr<RemotePage>)> RemotePageCallback;
+ using RemotePageCallback = base::Callback<void(scoped_refptr<RemotePage>)>;
void OpenRemotePage(scoped_refptr<RemoteBrowser> browser,
const std::string& url);
@@ -217,6 +217,9 @@ class DevToolsAndroidBridge : public KeyedService {
const std::string& url,
const JsonRequestCallback& callback);
+ using TCPProviderCallback =
+ base::Callback<void(scoped_refptr<TCPDeviceProvider>)>;
+ void set_tcp_provider_callback_for_test(TCPProviderCallback callback);
private:
friend struct content::BrowserThread::DeleteOnThread<
content::BrowserThread::UI>;
@@ -234,10 +237,10 @@ class DevToolsAndroidBridge : public KeyedService {
void StopDeviceListPolling();
bool NeedsDeviceListPolling();
- typedef std::pair<scoped_refptr<AndroidDeviceManager::Device>,
- scoped_refptr<RemoteDevice>> CompleteDevice;
- typedef std::vector<CompleteDevice> CompleteDevices;
- typedef base::Callback<void(const CompleteDevices&)> DeviceListCallback;
+ using CompleteDevice = std::pair<scoped_refptr<AndroidDeviceManager::Device>,
+ scoped_refptr<RemoteDevice>>;
+ using CompleteDevices = std::vector<CompleteDevice>;
+ using DeviceListCallback = base::Callback<void(const CompleteDevices&)>;
void RequestDeviceList(const DeviceListCallback& callback);
void ReceivedDeviceList(const CompleteDevices& complete_devices);
@@ -271,28 +274,30 @@ class DevToolsAndroidBridge : public KeyedService {
Profile* const profile_;
const std::unique_ptr<AndroidDeviceManager> device_manager_;
- typedef std::map<std::string, scoped_refptr<AndroidDeviceManager::Device>>
- DeviceMap;
+ using DeviceMap =
+ std::map<std::string, scoped_refptr<AndroidDeviceManager::Device> >;
DeviceMap device_map_;
- typedef std::map<std::string, AgentHostDelegate*> AgentHostDelegates;
+ using AgentHostDelegates = std::map<std::string, AgentHostDelegate*>;
AgentHostDelegates host_delegates_;
- typedef std::vector<DeviceListListener*> DeviceListListeners;
+ using DeviceListListeners = std::vector<DeviceListListener*>;
DeviceListListeners device_list_listeners_;
base::CancelableCallback<void(const CompleteDevices&)> device_list_callback_;
- typedef std::vector<DeviceCountListener*> DeviceCountListeners;
+ using DeviceCountListeners = std::vector<DeviceCountListener*>;
DeviceCountListeners device_count_listeners_;
base::CancelableCallback<void(int)> device_count_callback_;
base::Callback<void(const base::Closure&)> task_scheduler_;
- typedef std::vector<PortForwardingListener*> PortForwardingListeners;
+ using PortForwardingListeners = std::vector<PortForwardingListener*>;
PortForwardingListeners port_forwarding_listeners_;
std::unique_ptr<PortForwardingController> port_forwarding_controller_;
PrefChangeRegistrar pref_change_registrar_;
+ TCPProviderCallback tcp_provider_callback_;
+
base::WeakPtrFactory<DevToolsAndroidBridge> weak_factory_;
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