diff options
Diffstat (limited to 'chrome/browser/ui/search/instant_controller.cc')
-rw-r--r-- | chrome/browser/ui/search/instant_controller.cc | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/chrome/browser/ui/search/instant_controller.cc b/chrome/browser/ui/search/instant_controller.cc index dea6d08..a5db87a21 100644 --- a/chrome/browser/ui/search/instant_controller.cc +++ b/chrome/browser/ui/search/instant_controller.cc @@ -117,29 +117,6 @@ void InstantController::SetSuggestionToPrefetch( } } -void InstantController::InstantPageLoadFailed(content::WebContents* contents) { - DCHECK(IsContentsFrom(instant_tab(), contents)); - - // Verify we're not already on a local page and that the URL precisely - // equals the instant_url (minus the query params, as those will be filled - // in by template values). This check is necessary to make sure we don't - // inadvertently redirect to the local NTP if someone, say, reloads a SRP - // while offline, as a committed results page still counts as an instant - // url. We also check to make sure there's no forward history, as if - // someone hits the back button a lot when offline and returns to a NTP - // we don't want to redirect and nuke their forward history stack. - const GURL& current_url = contents->GetURL(); - GURL instant_url = chrome::GetInstantURL(profile(), - chrome::kDisableStartMargin, false); - if (instant_tab_->IsLocal() || - !search::MatchesOriginAndPath(instant_url, current_url) || - !current_url.ref().empty() || - contents->GetController().CanGoForward()) - return; - LOG_INSTANT_DEBUG_EVENT(this, "InstantPageLoadFailed: instant_tab"); - RedirectToLocalNTP(contents); -} - bool InstantController::SubmitQuery(const base::string16& search_terms) { if (instant_tab_ && instant_tab_->supports_instant() && search_mode_.is_origin_search()) { @@ -296,17 +273,6 @@ bool InstantController::IsInputInProgress() const { omnibox_focus_state_ == OMNIBOX_FOCUS_VISIBLE; } -void InstantController::RedirectToLocalNTP(content::WebContents* contents) { - contents->GetController().LoadURL( - GURL(chrome::kChromeSearchLocalNtpUrl), - content::Referrer(), - content::PAGE_TRANSITION_SERVER_REDIRECT, - std::string()); // No extra headers. - // TODO(dcblack): Remove extraneous history entry caused by 404s. - // Note that the base case of a 204 being returned doesn't push a history - // entry. -} - InstantService* InstantController::GetInstantService() const { return InstantServiceFactory::GetForProfile(profile()); } |