| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "android_webview/browser/aw_dev_tools_discovery_provider.h" | 5 #include "android_webview/browser/aw_dev_tools_discovery_provider.h" |
| 6 | 6 |
| 7 #include "android_webview/browser/browser_view_renderer.h" | 7 #include "android_webview/browser/browser_view_renderer.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 discovery_manager->AddProvider( | 51 discovery_manager->AddProvider( |
| 52 base::WrapUnique(new AwDevToolsDiscoveryProvider())); | 52 base::WrapUnique(new AwDevToolsDiscoveryProvider())); |
| 53 } | 53 } |
| 54 | 54 |
| 55 AwDevToolsDiscoveryProvider::AwDevToolsDiscoveryProvider() { | 55 AwDevToolsDiscoveryProvider::AwDevToolsDiscoveryProvider() { |
| 56 } | 56 } |
| 57 | 57 |
| 58 AwDevToolsDiscoveryProvider::~AwDevToolsDiscoveryProvider() { | 58 AwDevToolsDiscoveryProvider::~AwDevToolsDiscoveryProvider() { |
| 59 } | 59 } |
| 60 | 60 |
| 61 devtools_discovery::DevToolsTargetDescriptor::List | 61 content::DevToolsAgentHost::List |
| 62 AwDevToolsDiscoveryProvider::GetDescriptors() { | 62 AwDevToolsDiscoveryProvider::GetDescriptors() { |
| 63 DevToolsAgentHost::List agent_hosts = DevToolsAgentHost::GetOrCreateAll(); | 63 DevToolsAgentHost::List agent_hosts = DevToolsAgentHost::GetOrCreateAll(); |
| 64 devtools_discovery::DevToolsTargetDescriptor::List result; | |
| 65 result.reserve(agent_hosts.size()); | |
| 66 for (auto& agent_host : agent_hosts) { | 64 for (auto& agent_host : agent_hosts) { |
| 67 agent_host->SetDescriptionOverride( | 65 agent_host->SetDescriptionOverride( |
| 68 GetViewDescription(agent_host->GetWebContents())); | 66 GetViewDescription(agent_host->GetWebContents())); |
| 69 result.push_back(new devtools_discovery::BasicTargetDescriptor(agent_host)); | |
| 70 } | 67 } |
| 71 return result; | 68 return agent_hosts; |
| 72 } | 69 } |
| 73 | 70 |
| 74 } // namespace android_webview | 71 } // namespace android_webview |
| OLD | NEW |