Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/tab_contents/render_view_host_manager.h" | 5 #include "chrome/browser/tab_contents/render_view_host_manager.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/dom_ui/dom_ui.h" | 9 #include "chrome/browser/dom_ui/dom_ui.h" |
| 10 #include "chrome/browser/dom_ui/dom_ui_factory.h" | 10 #include "chrome/browser/dom_ui/dom_ui_factory.h" |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 291 const NavigationEntry* cur_entry, | 291 const NavigationEntry* cur_entry, |
| 292 const NavigationEntry* new_entry) const { | 292 const NavigationEntry* new_entry) const { |
| 293 DCHECK(new_entry); | 293 DCHECK(new_entry); |
| 294 | 294 |
| 295 if (!cur_entry) { | 295 if (!cur_entry) { |
| 296 // Always choose a new process when navigating to extension URLs. The | 296 // Always choose a new process when navigating to extension URLs. The |
| 297 // process grouping logic will combine all of a given extension's pages | 297 // process grouping logic will combine all of a given extension's pages |
| 298 // into the same process. | 298 // into the same process. |
| 299 if (new_entry->url().SchemeIs(chrome::kExtensionScheme)) | 299 if (new_entry->url().SchemeIs(chrome::kExtensionScheme)) |
| 300 return true; | 300 return true; |
| 301 // When a tab is created, it starts as TYPE_NORMAL. If the new entry is a | |
| 302 // DOM UI page, it needs to be grouped with other DOM UI pages. This matches | |
| 303 // the logic when transitioning between DOM UI and normal pages. | |
| 304 // Profile* profile = delegate_->GetControllerForRenderManager().profile(); | |
| 305 // if (DOMUIFactory::UseDOMUIForURL(profile, new_entry->url())) | |
| 306 // return true; | |
|
Charlie Reis
2011/01/06 23:30:54
These shouldn't be commented out.
| |
| 301 return false; | 307 return false; |
| 302 } | 308 } |
| 303 | 309 |
| 304 // We can't switch a RenderView between view source and non-view source mode | 310 // We can't switch a RenderView between view source and non-view source mode |
| 305 // without screwing up the session history sometimes (when navigating between | 311 // without screwing up the session history sometimes (when navigating between |
| 306 // "view-source:http://foo.com/" and "http://foo.com/", WebKit doesn't treat | 312 // "view-source:http://foo.com/" and "http://foo.com/", WebKit doesn't treat |
| 307 // it as a new navigation). So require a view switch. | 313 // it as a new navigation). So require a view switch. |
| 308 if (cur_entry->IsViewSourceMode() != new_entry->IsViewSourceMode()) | 314 if (cur_entry->IsViewSourceMode() != new_entry->IsViewSourceMode()) |
| 309 return true; | 315 return true; |
| 310 | 316 |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 713 Source<NavigationController>(&delegate_->GetControllerForRenderManager()), | 719 Source<NavigationController>(&delegate_->GetControllerForRenderManager()), |
| 714 Details<RenderViewHostSwitchedDetails>(&details)); | 720 Details<RenderViewHostSwitchedDetails>(&details)); |
| 715 | 721 |
| 716 // This will cause the old RenderViewHost to delete itself. | 722 // This will cause the old RenderViewHost to delete itself. |
| 717 old_render_view_host->Shutdown(); | 723 old_render_view_host->Shutdown(); |
| 718 | 724 |
| 719 // Let the task manager know that we've swapped RenderViewHosts, since it | 725 // Let the task manager know that we've swapped RenderViewHosts, since it |
| 720 // might need to update its process groupings. | 726 // might need to update its process groupings. |
| 721 delegate_->NotifySwappedFromRenderManager(); | 727 delegate_->NotifySwappedFromRenderManager(); |
| 722 } | 728 } |
| OLD | NEW |