| 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/devtools/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" |
| 11 #include "content/browser/child_process_security_policy_impl.h" | 11 #include "content/browser/child_process_security_policy_impl.h" |
| 12 #include "content/browser/debugger/devtools_netlog_observer.h" | 12 #include "content/browser/devtools/devtools_netlog_observer.h" |
| 13 #include "content/browser/debugger/render_view_devtools_agent_host.h" | 13 #include "content/browser/devtools/render_view_devtools_agent_host.h" |
| 14 #include "content/browser/renderer_host/render_view_host_impl.h" | 14 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 15 #include "content/browser/web_contents/web_contents_impl.h" | 15 #include "content/browser/web_contents/web_contents_impl.h" |
| 16 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 17 #include "content/public/browser/devtools_agent_host_registry.h" |
| 17 #include "content/public/browser/devtools_client_host.h" | 18 #include "content/public/browser/devtools_client_host.h" |
| 18 #include "content/public/browser/devtools_agent_host_registry.h" | |
| 19 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
| 20 | 20 |
| 21 namespace content { | 21 namespace content { |
| 22 | 22 |
| 23 // static | 23 // static |
| 24 DevToolsManager* DevToolsManager::GetInstance() { | 24 DevToolsManager* DevToolsManager::GetInstance() { |
| 25 return DevToolsManagerImpl::GetInstance(); | 25 return DevToolsManagerImpl::GetInstance(); |
| 26 } | 26 } |
| 27 | 27 |
| 28 // static | 28 // static |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 void DevToolsManagerImpl::DispatchOnInspectorFrontend( | 79 void DevToolsManagerImpl::DispatchOnInspectorFrontend( |
| 80 DevToolsAgentHost* agent_host, | 80 DevToolsAgentHost* agent_host, |
| 81 const std::string& message) { | 81 const std::string& message) { |
| 82 DevToolsClientHost* client_host = GetDevToolsClientHostFor(agent_host); | 82 DevToolsClientHost* client_host = GetDevToolsClientHostFor(agent_host); |
| 83 if (!client_host) { | 83 if (!client_host) { |
| 84 // Client window was closed while there were messages | 84 // Client window was closed while there were messages |
| 85 // being sent to it. | 85 // being sent to it. |
| 86 return; | 86 return; |
| 87 } | 87 } |
| 88 client_host->DispatchOnInspectorFrontend(message); | |
| 89 } | 88 } |
| 90 | 89 |
| 91 void DevToolsManagerImpl::SaveAgentRuntimeState(DevToolsAgentHost* agent_host, | 90 void DevToolsManagerImpl::SaveAgentRuntimeState(DevToolsAgentHost* agent_host, |
| 92 const std::string& state) { | 91 const std::string& state) { |
| 93 agent_runtime_states_[agent_host] = state; | 92 agent_runtime_states_[agent_host] = state; |
| 94 } | 93 } |
| 95 | 94 |
| 96 void DevToolsManagerImpl::InspectElement(DevToolsAgentHost* agent_host, | 95 void DevToolsManagerImpl::InspectElement(DevToolsAgentHost* agent_host, |
| 97 int x, int y) { | 96 int x, int y) { |
| 98 agent_host->InspectElement(x, y); | 97 agent_host->InspectElement(x, y); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 it != agent_to_client_host_.end(); ++it) { | 292 it != agent_to_client_host_.end(); ++it) { |
| 294 agents.push_back(it->first); | 293 agents.push_back(it->first); |
| 295 } | 294 } |
| 296 for (std::vector<DevToolsAgentHost*>::iterator it = agents.begin(); | 295 for (std::vector<DevToolsAgentHost*>::iterator it = agents.begin(); |
| 297 it != agents.end(); ++it) { | 296 it != agents.end(); ++it) { |
| 298 UnregisterDevToolsClientHostFor(*it); | 297 UnregisterDevToolsClientHostFor(*it); |
| 299 } | 298 } |
| 300 } | 299 } |
| 301 | 300 |
| 302 } // namespace content | 301 } // namespace content |
| OLD | NEW |