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

Unified Diff: chrome/browser/ui/browser_navigator.cc

Issue 137993020: (Try 2) InstantExtended: remove dead code related to the non-cacheable NTP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable InstantPolicyTests Created 6 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser_instant_controller.cc ('k') | chrome/browser/ui/search/instant_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_navigator.cc
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc
index 579e73343ee09a19aca728ef7076f745a93f9d6b..90c242e8ba21fcf0b961d39def3a6afee98e4088 100644
--- a/chrome/browser/ui/browser_navigator.cc
+++ b/chrome/browser/ui/browser_navigator.cc
@@ -378,14 +378,6 @@ bool SwapInPrerender(const GURL& url, chrome::NavigateParams* params) {
prerender_manager->MaybeUsePrerenderedPage(url, params);
}
-bool SwapInInstantNTP(chrome::NavigateParams* params,
- const GURL& url,
- content::WebContents* source_contents) {
- BrowserInstantController* instant = params->browser->instant_controller();
- return instant && instant->MaybeSwapInInstantNTPContents(
- url, source_contents, &params->target_contents);
-}
-
chrome::HostDesktopType GetHostDesktop(Browser* browser) {
if (browser)
return browser->host_desktop_type();
@@ -582,8 +574,8 @@ void Navigate(NavigateParams* params) {
// Check if this is a singleton tab that already exists
int singleton_index = chrome::GetIndexOfSingletonTab(params);
- // Did we use Instant's NTP contents or a prerender?
- bool swapped_in = false;
+ // Did we use a prerender?
+ bool swapped_in_prerender = false;
// If no target WebContents was specified, we need to construct one if
// we are supposed to target a new tab; unless it's a singleton that already
@@ -599,9 +591,7 @@ void Navigate(NavigateParams* params) {
}
if (params->disposition != CURRENT_TAB) {
- swapped_in = SwapInInstantNTP(params, url, NULL);
- if (!swapped_in)
- params->target_contents = CreateTargetContents(*params, url);
+ params->target_contents = CreateTargetContents(*params, url);
// This function takes ownership of |params->target_contents| until it
// is added to a TabStripModel.
@@ -610,9 +600,7 @@ void Navigate(NavigateParams* params) {
// ... otherwise if we're loading in the current tab, the target is the
// same as the source.
DCHECK(params->source_contents);
- swapped_in = SwapInInstantNTP(params, url, params->source_contents);
- if (!swapped_in)
- params->target_contents = params->source_contents;
+ params->target_contents = params->source_contents;
DCHECK(params->target_contents);
// Prerender expects |params->target_contents| to be attached to a browser
// window, so only call for CURRENT_TAB navigations. (Others are currently
@@ -625,14 +613,13 @@ void Navigate(NavigateParams* params) {
// Therefore, we should swap in regardless of CURRENT_TAB, and instead,
// check in the swapin function whether the WebContents is not in a
// TabStrip model, in which case we must not swap in.
- if (!swapped_in)
- swapped_in = SwapInPrerender(url, params);
+ swapped_in_prerender = SwapInPrerender(url, params);
}
if (user_initiated)
params->target_contents->UserGestureDone();
- if (!swapped_in) {
+ if (!swapped_in_prerender) {
// Try to handle non-navigational URLs that popup dialogs and such, these
// should not actually navigate.
if (!HandleNonNavigationAboutURL(url)) {
@@ -665,7 +652,7 @@ void Navigate(NavigateParams* params) {
params->source_contents->GetView()->Focus();
if (params->source_contents == params->target_contents ||
- (swapped_in && params->disposition == CURRENT_TAB)) {
+ (swapped_in_prerender && params->disposition == CURRENT_TAB)) {
// The navigation occurred in the source tab.
params->browser->UpdateUIForNavigationInTab(params->target_contents,
params->transition,
« no previous file with comments | « chrome/browser/ui/browser_instant_controller.cc ('k') | chrome/browser/ui/search/instant_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698