Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1525)

Side by Side Diff: content/browser/debugger/devtools_manager.cc

Issue 8572010: DevTools: reattach to previous RVH when pending navigation is being canceled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing OVERRIDE Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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.h" 5 #include "content/browser/debugger/devtools_manager.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
153 int cookie = DetachClientHost(rvh); 153 int cookie = DetachClientHost(rvh);
154 if (cookie != -1) { 154 if (cookie != -1) {
155 // Navigating to URL in the inspected window. 155 // Navigating to URL in the inspected window.
156 AttachClientHost(cookie, dest_rvh); 156 AttachClientHost(cookie, dest_rvh);
157 157
158 DevToolsClientHost* client_host = GetDevToolsClientHostFor(dest_rvh); 158 DevToolsClientHost* client_host = GetDevToolsClientHostFor(dest_rvh);
159 client_host->FrameNavigating(gurl.spec()); 159 client_host->FrameNavigating(gurl.spec());
160 } 160 }
161 } 161 }
162 162
163 void DevToolsManager::OnCancelPendingNavigation(RenderViewHost* pending,
164 RenderViewHost* current) {
165 int cookie = DetachClientHost(pending);
166 if (cookie != -1) {
167 // Navigating to URL in the inspected window.
168 AttachClientHost(cookie, current);
169 }
170 }
171
163 void DevToolsManager::TabReplaced(TabContents* old_tab, 172 void DevToolsManager::TabReplaced(TabContents* old_tab,
164 TabContents* new_tab) { 173 TabContents* new_tab) {
165 RenderViewHost* old_rvh = old_tab->render_view_host(); 174 RenderViewHost* old_rvh = old_tab->render_view_host();
166 DevToolsClientHost* client_host = GetDevToolsClientHostFor(old_rvh); 175 DevToolsClientHost* client_host = GetDevToolsClientHostFor(old_rvh);
167 if (!client_host) 176 if (!client_host)
168 return; // Didn't know about old_tab. 177 return; // Didn't know about old_tab.
169 int cookie = DetachClientHost(old_rvh); 178 int cookie = DetachClientHost(old_rvh);
170 if (cookie == -1) 179 if (cookie == -1)
171 return; // Didn't know about old_tab. 180 return; // Didn't know about old_tab.
172 181
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 for (AgentToClientHostMap::iterator it = 288 for (AgentToClientHostMap::iterator it =
280 agent_to_client_host_.begin(); 289 agent_to_client_host_.begin();
281 it != agent_to_client_host_.end(); ++it) { 290 it != agent_to_client_host_.end(); ++it) {
282 agents.push_back(it->first); 291 agents.push_back(it->first);
283 } 292 }
284 for (std::vector<DevToolsAgentHost*>::iterator it = agents.begin(); 293 for (std::vector<DevToolsAgentHost*>::iterator it = agents.begin();
285 it != agents.end(); ++it) { 294 it != agents.end(); ++it) {
286 UnregisterDevToolsClientHostFor(*it); 295 UnregisterDevToolsClientHostFor(*it);
287 } 296 }
288 } 297 }
OLDNEW
« no previous file with comments | « content/browser/debugger/devtools_manager.h ('k') | content/browser/debugger/devtools_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698