| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/debugger/devtools_manager_impl.h" | 5 #include "content/browser/debugger/devtools_manager_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 int x, int y) { | 97 int x, int y) { |
| 98 agent_host->InspectElement(x, y); | 98 agent_host->InspectElement(x, y); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void DevToolsManagerImpl::AddMessageToConsole(DevToolsAgentHost* agent_host, | 101 void DevToolsManagerImpl::AddMessageToConsole(DevToolsAgentHost* agent_host, |
| 102 ConsoleMessageLevel level, | 102 ConsoleMessageLevel level, |
| 103 const std::string& message) { | 103 const std::string& message) { |
| 104 agent_host->AddMessageToConsole(level, message); | 104 agent_host->AddMessageToConsole(level, message); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void DevToolsManagerImpl::ClientHostOpening(DevToolsClientHost* client_host) { |
| 108 DevToolsAgentHost* agent_host = GetDevToolsAgentHostFor(client_host); |
| 109 if (agent_host) |
| 110 agent_host->NotifyClientOpening(); |
| 111 } |
| 112 |
| 107 void DevToolsManagerImpl::ClientHostClosing(DevToolsClientHost* client_host) { | 113 void DevToolsManagerImpl::ClientHostClosing(DevToolsClientHost* client_host) { |
| 108 DevToolsAgentHost* agent_host = GetDevToolsAgentHostFor(client_host); | 114 DevToolsAgentHost* agent_host = GetDevToolsAgentHostFor(client_host); |
| 109 if (!agent_host) { | 115 if (!agent_host) { |
| 110 // It might be in the list of orphan client hosts, remove it from there. | 116 // It might be in the list of orphan client hosts, remove it from there. |
| 111 for (OrphanClientHosts::iterator it = orphan_client_hosts_.begin(); | 117 for (OrphanClientHosts::iterator it = orphan_client_hosts_.begin(); |
| 112 it != orphan_client_hosts_.end(); ++it) { | 118 it != orphan_client_hosts_.end(); ++it) { |
| 113 if (it->second.first == client_host) { | 119 if (it->second.first == client_host) { |
| 114 orphan_client_hosts_.erase(it->first); | 120 orphan_client_hosts_.erase(it->first); |
| 115 return; | 121 return; |
| 116 } | 122 } |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 it != agent_to_client_host_.end(); ++it) { | 301 it != agent_to_client_host_.end(); ++it) { |
| 296 agents.push_back(it->first); | 302 agents.push_back(it->first); |
| 297 } | 303 } |
| 298 for (std::vector<DevToolsAgentHost*>::iterator it = agents.begin(); | 304 for (std::vector<DevToolsAgentHost*>::iterator it = agents.begin(); |
| 299 it != agents.end(); ++it) { | 305 it != agents.end(); ++it) { |
| 300 UnregisterDevToolsClientHostFor(*it); | 306 UnregisterDevToolsClientHostFor(*it); |
| 301 } | 307 } |
| 302 } | 308 } |
| 303 | 309 |
| 304 } // namespace content | 310 } // namespace content |
| OLD | NEW |