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/web_contents/render_view_host_manager.h" | 5 #include "content/browser/web_contents/render_view_host_manager.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 } | 424 } |
425 } else { | 425 } else { |
426 // Force swap if it's a Web UI URL. | 426 // Force swap if it's a Web UI URL. |
427 if (WebUIControllerFactoryRegistry::GetInstance()->UseWebUIForURL( | 427 if (WebUIControllerFactoryRegistry::GetInstance()->UseWebUIForURL( |
428 browser_context, new_entry->GetURL())) { | 428 browser_context, new_entry->GetURL())) { |
429 return true; | 429 return true; |
430 } | 430 } |
431 } | 431 } |
432 | 432 |
433 if (GetContentClient()->browser()->ShouldSwapProcessesForNavigation( | 433 if (GetContentClient()->browser()->ShouldSwapProcessesForNavigation( |
434 curr_entry ? curr_entry->GetURL() : GURL(), new_entry->GetURL())) { | 434 render_view_host_->GetSiteInstance(), |
| 435 curr_entry ? curr_entry->GetURL() : GURL(), |
| 436 new_entry->GetURL())) { |
435 return true; | 437 return true; |
436 } | 438 } |
437 | 439 |
438 if (!curr_entry) | 440 if (!curr_entry) |
439 return false; | 441 return false; |
440 | 442 |
441 // We can't switch a RenderView between view source and non-view source mode | 443 // We can't switch a RenderView between view source and non-view source mode |
442 // without screwing up the session history sometimes (when navigating between | 444 // without screwing up the session history sometimes (when navigating between |
443 // "view-source:http://foo.com/" and "http://foo.com/", WebKit doesn't treat | 445 // "view-source:http://foo.com/" and "http://foo.com/", WebKit doesn't treat |
444 // it as a new navigation). So require a view switch. | 446 // it as a new navigation). So require a view switch. |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 RenderViewHostImpl* RenderViewHostManager::GetSwappedOutRenderViewHost( | 971 RenderViewHostImpl* RenderViewHostManager::GetSwappedOutRenderViewHost( |
970 SiteInstance* instance) { | 972 SiteInstance* instance) { |
971 RenderViewHostMap::iterator iter = swapped_out_hosts_.find(instance->GetId()); | 973 RenderViewHostMap::iterator iter = swapped_out_hosts_.find(instance->GetId()); |
972 if (iter != swapped_out_hosts_.end()) | 974 if (iter != swapped_out_hosts_.end()) |
973 return iter->second; | 975 return iter->second; |
974 | 976 |
975 return NULL; | 977 return NULL; |
976 } | 978 } |
977 | 979 |
978 } // namespace content | 980 } // namespace content |
OLD | NEW |