From d6909df7f19dbb2b6e98ee36ff0bd8ec28687467 Mon Sep 17 00:00:00 2001 From: "sreeram@chromium.org" Date: Wed, 25 Jan 2012 01:46:35 +0000 Subject: Failover to omnibox search if the Instant loader isn't ready. If the loader isn't ready or has a failed HTTP status code, make use of that to fail over to a regular omnibox search in the HIDDEN and SUGGEST field trials. The visible INSTANT trial already does so. Unfortunately for the SILENT trial, since the first Update happens only at commit time, we can't use this logic. BUG=110962 TEST=none Review URL: https://chromiumcodereview.appspot.com/9283032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118976 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/instant/instant_controller.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'chrome/browser/instant/instant_controller.cc') diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc index b4bed14..f39ecfa 100644 --- a/chrome/browser/instant/instant_controller.cc +++ b/chrome/browser/instant/instant_controller.cc @@ -260,6 +260,13 @@ bool InstantController::PrepareForCommit() { return false; } + // In the HIDDEN and SUGGEST experiments (but not SILENT), we must have sent + // an Update() by now, so check if the loader failed to process it. + if (!InstantFieldTrial::IsSilentExperiment(tab_contents_->profile()) && + (!loader_->ready() || !loader_->http_status_ok())) { + return false; + } + // Ignore the suggested text, as we are about to commit the verbatim query. string16 suggested_text; UpdateLoader(template_url, last_url_, last_transition_type_, last_user_text_, -- cgit v1.1