diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-10 02:32:23 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-10 02:32:23 +0000 |
commit | 4c1b035dd362ef394df78a5abdb46c6242d22fc4 (patch) | |
tree | 4049487516eb324ac8237901bc5d3b47fe9b0e00 /chrome/browser/instant/instant_controller.cc | |
parent | 7b6c5e446f0b342f3ce074ac3462f99ed67fa8fd (diff) | |
download | chromium_src-4c1b035dd362ef394df78a5abdb46c6242d22fc4.zip chromium_src-4c1b035dd362ef394df78a5abdb46c6242d22fc4.tar.gz chromium_src-4c1b035dd362ef394df78a5abdb46c6242d22fc4.tar.bz2 |
Fixes bug where we would show an instant preview when we thought the
search engine supported instant but it doesn't.
BUG=66133
TEST=covered by interactive ui test. You can also manually test
Review URL: http://codereview.chromium.org/5771001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68816 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/instant/instant_controller.cc')
-rw-r--r-- | chrome/browser/instant/instant_controller.cc | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc index 4e58b8f..c2e8ab6 100644 --- a/chrome/browser/instant/instant_controller.cc +++ b/chrome/browser/instant/instant_controller.cc @@ -371,29 +371,27 @@ void InstantController::CommitInstantLoader(InstantLoader* loader) { } void InstantController::InstantLoaderDoesntSupportInstant( - InstantLoader* loader, - bool needs_reload, - const GURL& url_to_load) { + InstantLoader* loader) { DCHECK(!loader->ready()); // We better not be showing this loader. DCHECK(loader->template_url_id()); + VLOG(1) << " provider does not support instant"; + + // Don't attempt to use instant for this search engine again. BlacklistFromInstant(loader->template_url_id()); if (loader_manager_->active_loader() == loader) { - // The loader is active. Continue to use it, but make sure it isn't tied to - // to the search engine anymore. ClearTemplateURLID ends up showing the - // loader. - loader_manager_->RemoveLoaderFromInstant(loader); - loader->ClearTemplateURLID(); - - if (needs_reload) { - string16 suggested_text; - loader->Update(tab_contents_, 0, url_to_load, last_transition_type_, - loader->user_text(), false, &suggested_text); - } + // The loader is active, shut down instant. + DestroyPreviewContents(); } else { + if (loader_manager_->current_loader() == loader && is_active_) { + // There is a pending loader and we're active. Hide the preview. When then + // pending loader finishes loading we'll notify the delegate to show. + DCHECK(loader_manager_->pending_loader()); + is_active_ = false; + delegate_->HideInstant(); + } loader_manager_->DestroyLoader(loader); - loader = NULL; } } |