| 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 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "content/browser/devtools/devtools_manager.h" | 10 #include "content/browser/devtools/devtools_manager.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 Response BrowserHandler::SendMessage(const std::string& target_id, | 138 Response BrowserHandler::SendMessage(const std::string& target_id, |
| 139 const std::string& message) { | 139 const std::string& message) { |
| 140 scoped_refptr<DevToolsAgentHost> agent_host = | 140 scoped_refptr<DevToolsAgentHost> agent_host = |
| 141 DevToolsAgentHost::GetForId(target_id); | 141 DevToolsAgentHost::GetForId(target_id); |
| 142 if (!agent_host) | 142 if (!agent_host) |
| 143 return Response::ServerError("No target with given id found"); | 143 return Response::ServerError("No target with given id found"); |
| 144 agent_host->DispatchProtocolMessage(this, message); | 144 agent_host->DispatchProtocolMessage(this, message); |
| 145 return Response::OK(); | 145 return Response::OK(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 Response BrowserHandler::SetRemoteLocations( | |
| 149 const std::vector<std::unique_ptr<base::DictionaryValue>>& locations) { | |
| 150 return Response::OK(); | |
| 151 } | |
| 152 | |
| 153 void BrowserHandler::DispatchProtocolMessage( | 148 void BrowserHandler::DispatchProtocolMessage( |
| 154 DevToolsAgentHost* agent_host, const std::string& message) { | 149 DevToolsAgentHost* agent_host, const std::string& message) { |
| 155 client_->DispatchMessage(DispatchMessageParams::Create()-> | 150 client_->DispatchMessage(DispatchMessageParams::Create()-> |
| 156 set_target_id(agent_host->GetId())-> | 151 set_target_id(agent_host->GetId())-> |
| 157 set_message(message)); | 152 set_message(message)); |
| 158 } | 153 } |
| 159 | 154 |
| 160 void BrowserHandler::AgentHostClosed(DevToolsAgentHost* agent_host, | 155 void BrowserHandler::AgentHostClosed(DevToolsAgentHost* agent_host, |
| 161 bool replaced_with_another_client) { | 156 bool replaced_with_another_client) { |
| 162 auto it = std::find( | 157 auto it = std::find( |
| 163 attached_hosts_.begin(), attached_hosts_.end(), agent_host); | 158 attached_hosts_.begin(), attached_hosts_.end(), agent_host); |
| 164 if (it != attached_hosts_.end()) | 159 if (it != attached_hosts_.end()) |
| 165 attached_hosts_.erase(it); | 160 attached_hosts_.erase(it); |
| 166 } | 161 } |
| 167 | 162 |
| 168 } // namespace browser | 163 } // namespace browser |
| 169 } // namespace devtools | 164 } // namespace devtools |
| 170 } // namespace content | 165 } // namespace content |
| OLD | NEW |