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

Unified Diff: trunk/src/chrome/browser/ui/search/instant_page.cc

Issue 135903002: Revert 244407 "InstantExtended: remove dead code related to the ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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
Index: trunk/src/chrome/browser/ui/search/instant_page.cc
===================================================================
--- trunk/src/chrome/browser/ui/search/instant_page.cc (revision 244428)
+++ trunk/src/chrome/browser/ui/search/instant_page.cc (working copy)
@@ -80,6 +80,28 @@
delegate_->InstantPageAboutToNavigateMainFrame(contents(), url);
}
+void InstantPage::DidNavigateMainFrame(
+ const content::LoadCommittedDetails& details,
+ const content::FrameNavigateParams& /* params */) {
+ // A 204 can be sent by the search provider as a lightweight signal
+ // to fall back to the local page, and we obviously want to fall back
+ // if we get any response code that indicates an error.
+ if (details.http_status_code == 204 || details.http_status_code >= 400)
+ delegate_->InstantPageLoadFailed(contents());
+}
+
+void InstantPage::DidFailProvisionalLoad(
+ int64 /* frame_id */,
+ const base::string16& frame_unique_name,
+ bool is_main_frame,
+ const GURL& /* validated_url */,
+ int /* error_code */,
+ const base::string16& /* error_description */,
+ content::RenderViewHost* /* render_view_host */) {
+ if (is_main_frame)
+ delegate_->InstantPageLoadFailed(contents());
+}
+
void InstantPage::ModelChanged(const SearchModel::State& old_state,
const SearchModel::State& new_state) {
if (old_state.instant_support != new_state.instant_support)
« no previous file with comments | « trunk/src/chrome/browser/ui/search/instant_page.h ('k') | trunk/src/chrome/browser/ui/search/instant_page_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698