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

Unified Diff: android_webview/browser/aw_dev_tools_discovery_provider.cc

Issue 2263843002: DevTools: merge devtools target with devtools host, part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for landing 3 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/android/dev_tools_discovery_provider_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/aw_dev_tools_discovery_provider.cc
diff --git a/android_webview/browser/aw_dev_tools_discovery_provider.cc b/android_webview/browser/aw_dev_tools_discovery_provider.cc
index 96cab3f708f4ec4ff91f9fbbbaaa709768264032..82b746c7633bfb3c3f117891feb5c89d9de766a3 100644
--- a/android_webview/browser/aw_dev_tools_discovery_provider.cc
+++ b/android_webview/browser/aw_dev_tools_discovery_provider.cc
@@ -40,25 +40,6 @@ std::string GetViewDescription(WebContents* web_contents) {
return json;
}
-class TargetDescriptor : public devtools_discovery::BasicTargetDescriptor {
- public:
- explicit TargetDescriptor(scoped_refptr<DevToolsAgentHost> agent_host);
-
- // devtools_discovery::BasicTargetDescriptor overrides.
- std::string GetDescription() const override { return description_; }
-
- private:
- std::string description_;
-
- DISALLOW_COPY_AND_ASSIGN(TargetDescriptor);
-};
-
-TargetDescriptor::TargetDescriptor(scoped_refptr<DevToolsAgentHost> agent_host)
- : BasicTargetDescriptor(agent_host) {
- if (WebContents* web_contents = agent_host->GetWebContents())
- description_ = GetViewDescription(web_contents);
-}
-
} // namespace
namespace android_webview {
@@ -82,8 +63,11 @@ AwDevToolsDiscoveryProvider::GetDescriptors() {
DevToolsAgentHost::List agent_hosts = DevToolsAgentHost::GetOrCreateAll();
devtools_discovery::DevToolsTargetDescriptor::List result;
result.reserve(agent_hosts.size());
- for (const auto& agent_host : agent_hosts)
- result.push_back(new TargetDescriptor(agent_host));
+ for (auto& agent_host : agent_hosts) {
+ agent_host->SetDescriptionOverride(
+ GetViewDescription(agent_host->GetWebContents()));
+ result.push_back(new devtools_discovery::BasicTargetDescriptor(agent_host));
+ }
return result;
}
« no previous file with comments | « no previous file | chrome/browser/android/dev_tools_discovery_provider_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698