| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 153 |
| 154 void DevToolsManagerImpl::OnCancelPendingNavigation(RenderViewHost* pending, | 154 void DevToolsManagerImpl::OnCancelPendingNavigation(RenderViewHost* pending, |
| 155 RenderViewHost* current) { | 155 RenderViewHost* current) { |
| 156 int cookie = DetachClientHost(pending); | 156 int cookie = DetachClientHost(pending); |
| 157 if (cookie != -1) { | 157 if (cookie != -1) { |
| 158 // Navigating to URL in the inspected window. | 158 // Navigating to URL in the inspected window. |
| 159 AttachClientHost(cookie, current); | 159 AttachClientHost(cookie, current); |
| 160 } | 160 } |
| 161 } | 161 } |
| 162 | 162 |
| 163 void DevToolsManagerImpl::TabReplaced(TabContents* old_tab, | 163 void DevToolsManagerImpl::TabReplaced(WebContents* old_tab, |
| 164 TabContents* new_tab) { | 164 WebContents* new_tab) { |
| 165 RenderViewHost* old_rvh = old_tab->GetRenderViewHost(); | 165 RenderViewHost* old_rvh = old_tab->GetRenderViewHost(); |
| 166 if (!DevToolsAgentHostRegistry::HasDevToolsAgentHost(old_rvh)) | 166 if (!DevToolsAgentHostRegistry::HasDevToolsAgentHost(old_rvh)) |
| 167 return; | 167 return; |
| 168 | 168 |
| 169 DevToolsAgentHost* old_agent_host = | 169 DevToolsAgentHost* old_agent_host = |
| 170 DevToolsAgentHostRegistry::GetDevToolsAgentHost(old_rvh); | 170 DevToolsAgentHostRegistry::GetDevToolsAgentHost(old_rvh); |
| 171 DevToolsClientHost* client_host = GetDevToolsClientHostFor(old_agent_host); | 171 DevToolsClientHost* client_host = GetDevToolsClientHostFor(old_agent_host); |
| 172 if (!client_host) | 172 if (!client_host) |
| 173 return; // Didn't know about old_tab. | 173 return; // Didn't know about old_tab. |
| 174 int cookie = DetachClientHost(old_rvh); | 174 int cookie = DetachClientHost(old_rvh); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 it != agent_to_client_host_.end(); ++it) { | 286 it != agent_to_client_host_.end(); ++it) { |
| 287 agents.push_back(it->first); | 287 agents.push_back(it->first); |
| 288 } | 288 } |
| 289 for (std::vector<DevToolsAgentHost*>::iterator it = agents.begin(); | 289 for (std::vector<DevToolsAgentHost*>::iterator it = agents.begin(); |
| 290 it != agents.end(); ++it) { | 290 it != agents.end(); ++it) { |
| 291 UnregisterDevToolsClientHostFor(*it); | 291 UnregisterDevToolsClientHostFor(*it); |
| 292 } | 292 } |
| 293 } | 293 } |
| 294 | 294 |
| 295 } // namespace content | 295 } // namespace content |
| OLD | NEW |