| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 123 |
| 124 void DevToolsManagerImpl::UnregisterDevToolsClientHostFor( | 124 void DevToolsManagerImpl::UnregisterDevToolsClientHostFor( |
| 125 DevToolsAgentHost* agent_host) { | 125 DevToolsAgentHost* agent_host) { |
| 126 DevToolsClientHost* client_host = GetDevToolsClientHostFor(agent_host); | 126 DevToolsClientHost* client_host = GetDevToolsClientHostFor(agent_host); |
| 127 if (!client_host) | 127 if (!client_host) |
| 128 return; | 128 return; |
| 129 UnbindClientHost(agent_host, client_host); | 129 UnbindClientHost(agent_host, client_host); |
| 130 client_host->InspectedTabClosing(); | 130 client_host->InspectedTabClosing(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void DevToolsManagerImpl::OnNavigatingToPendingEntry(RenderViewHost* rvh, | 133 void DevToolsManagerImpl::OnNavigatingToPendingEntry( |
| 134 RenderViewHost* dest_rvh, | 134 RenderViewHost* rvh, |
| 135 const GURL& gurl) { | 135 RenderViewHost* dest_rvh, |
| 136 if (rvh == dest_rvh && rvh->render_view_termination_status() == | 136 const GURL& gurl) { |
| 137 base::TERMINATION_STATUS_STILL_RUNNING) | 137 if (rvh == dest_rvh && static_cast<RenderViewHostImpl*>( |
| 138 rvh)->render_view_termination_status() == |
| 139 base::TERMINATION_STATUS_STILL_RUNNING) |
| 138 return; | 140 return; |
| 139 int cookie = DetachClientHost(rvh); | 141 int cookie = DetachClientHost(rvh); |
| 140 if (cookie != -1) { | 142 if (cookie != -1) { |
| 141 // Navigating to URL in the inspected window. | 143 // Navigating to URL in the inspected window. |
| 142 AttachClientHost(cookie, dest_rvh); | 144 AttachClientHost(cookie, dest_rvh); |
| 143 | 145 |
| 144 DevToolsAgentHost* dest_agent_host = | 146 DevToolsAgentHost* dest_agent_host = |
| 145 DevToolsAgentHostRegistry::GetDevToolsAgentHost(dest_rvh); | 147 DevToolsAgentHostRegistry::GetDevToolsAgentHost(dest_rvh); |
| 146 DevToolsClientHost* client_host = GetDevToolsClientHostFor( | 148 DevToolsClientHost* client_host = GetDevToolsClientHostFor( |
| 147 dest_agent_host); | 149 dest_agent_host); |
| 148 client_host->FrameNavigating(gurl.spec()); | 150 client_host->FrameNavigating(gurl.spec()); |
| 149 } | 151 } |
| 150 } | 152 } |
| 151 | 153 |
| 152 void DevToolsManagerImpl::OnCancelPendingNavigation(RenderViewHost* pending, | 154 void DevToolsManagerImpl::OnCancelPendingNavigation( |
| 153 RenderViewHost* current) { | 155 RenderViewHost* pending, |
| 156 RenderViewHost* current) { |
| 154 int cookie = DetachClientHost(pending); | 157 int cookie = DetachClientHost(pending); |
| 155 if (cookie != -1) { | 158 if (cookie != -1) { |
| 156 // Navigating to URL in the inspected window. | 159 // Navigating to URL in the inspected window. |
| 157 AttachClientHost(cookie, current); | 160 AttachClientHost(cookie, current); |
| 158 } | 161 } |
| 159 } | 162 } |
| 160 | 163 |
| 161 void DevToolsManagerImpl::TabReplaced(WebContents* old_tab, | 164 void DevToolsManagerImpl::TabReplaced(WebContents* old_tab, |
| 162 WebContents* new_tab) { | 165 WebContents* new_tab) { |
| 163 RenderViewHost* old_rvh = old_tab->GetRenderViewHost(); | 166 RenderViewHost* old_rvh = old_tab->GetRenderViewHost(); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 it != agent_to_client_host_.end(); ++it) { | 289 it != agent_to_client_host_.end(); ++it) { |
| 287 agents.push_back(it->first); | 290 agents.push_back(it->first); |
| 288 } | 291 } |
| 289 for (std::vector<DevToolsAgentHost*>::iterator it = agents.begin(); | 292 for (std::vector<DevToolsAgentHost*>::iterator it = agents.begin(); |
| 290 it != agents.end(); ++it) { | 293 it != agents.end(); ++it) { |
| 291 UnregisterDevToolsClientHostFor(*it); | 294 UnregisterDevToolsClientHostFor(*it); |
| 292 } | 295 } |
| 293 } | 296 } |
| 294 | 297 |
| 295 } // namespace content | 298 } // namespace content |
| OLD | NEW |