| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/browser/devtools/protocol/browser_handler.h" | 5 #include "content/browser/devtools/protocol/browser_handler.h" |
| 6 | 6 |
| 7 namespace content { | 7 namespace content { |
| 8 namespace devtools { | 8 namespace devtools { |
| 9 namespace browser { | 9 namespace browser { |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 DevToolsAgentHost::List agents = DevToolsAgentHost::GetOrCreateAll(); | 80 DevToolsAgentHost::List agents = DevToolsAgentHost::GetOrCreateAll(); |
| 81 for (DevToolsAgentHost::List::iterator it = agents.begin(); | 81 for (DevToolsAgentHost::List::iterator it = agents.begin(); |
| 82 it != agents.end(); ++it) { | 82 it != agents.end(); ++it) { |
| 83 DevToolsAgentHost* agent_host = (*it).get(); | 83 DevToolsAgentHost* agent_host = (*it).get(); |
| 84 scoped_refptr<devtools::browser::TargetInfo> info = | 84 scoped_refptr<devtools::browser::TargetInfo> info = |
| 85 devtools::browser::TargetInfo::Create()-> | 85 devtools::browser::TargetInfo::Create()-> |
| 86 set_target_id(agent_host->GetId())-> | 86 set_target_id(agent_host->GetId())-> |
| 87 set_type(GetTypeString(agent_host))-> | 87 set_type(GetTypeString(agent_host))-> |
| 88 set_title(agent_host->GetTitle())-> | 88 set_title(agent_host->GetTitle())-> |
| 89 set_url(agent_host->GetURL().spec()); | 89 set_url(agent_host->GetURL().spec()); |
| 90 infos->push_back(info); |
| 90 } | 91 } |
| 91 return Response::OK(); | 92 return Response::OK(); |
| 92 } | 93 } |
| 93 | 94 |
| 94 Response BrowserHandler::Attach(const std::string& targetId) { | 95 Response BrowserHandler::Attach(const std::string& targetId) { |
| 95 scoped_refptr<DevToolsAgentHost> agent_host = | 96 scoped_refptr<DevToolsAgentHost> agent_host = |
| 96 DevToolsAgentHost::GetForId(targetId); | 97 DevToolsAgentHost::GetForId(targetId); |
| 97 if (!agent_host) | 98 if (!agent_host) |
| 98 return Response::ServerError("No target with given id found"); | 99 return Response::ServerError("No target with given id found"); |
| 99 bool success = agent_host->AttachClient(this); | 100 bool success = agent_host->AttachClient(this); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 128 set_message(message)); | 129 set_message(message)); |
| 129 } | 130 } |
| 130 | 131 |
| 131 void BrowserHandler::AgentHostClosed(DevToolsAgentHost* agent_host, | 132 void BrowserHandler::AgentHostClosed(DevToolsAgentHost* agent_host, |
| 132 bool replaced_with_another_client) { | 133 bool replaced_with_another_client) { |
| 133 } | 134 } |
| 134 | 135 |
| 135 } // namespace browser | 136 } // namespace browser |
| 136 } // namespace devtools | 137 } // namespace devtools |
| 137 } // namespace content | 138 } // namespace content |
| OLD | NEW |