diff options
author | sreeram@chromium.org <sreeram@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-25 01:46:35 +0000 |
---|---|---|
committer | sreeram@chromium.org <sreeram@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-25 01:46:35 +0000 |
commit | d6909df7f19dbb2b6e98ee36ff0bd8ec28687467 (patch) | |
tree | 90bb41fb6cf0cc5c6b937e149f02b68ea4843c15 /chrome/browser/instant/instant_controller.cc | |
parent | a504ba7dfbcbc6b1d726cead0020aec7d526ba99 (diff) | |
download | chromium_src-d6909df7f19dbb2b6e98ee36ff0bd8ec28687467.zip chromium_src-d6909df7f19dbb2b6e98ee36ff0bd8ec28687467.tar.gz chromium_src-d6909df7f19dbb2b6e98ee36ff0bd8ec28687467.tar.bz2 |
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
Diffstat (limited to 'chrome/browser/instant/instant_controller.cc')
-rw-r--r-- | chrome/browser/instant/instant_controller.cc | 7 |
1 files changed, 7 insertions, 0 deletions
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_, |