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

Unified Diff: chrome/browser/instant/instant_controller.cc

Issue 5720002: Merge 68816 - Fixes bug where we would show an instant preview when we though... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/597/src/
Patch Set: Created 10 years 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
« no previous file with comments | « chrome/browser/instant/instant_controller.h ('k') | chrome/browser/instant/instant_loader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/instant/instant_controller.cc
===================================================================
--- chrome/browser/instant/instant_controller.cc (revision 68817)
+++ chrome/browser/instant/instant_controller.cc (working copy)
@@ -371,29 +371,27 @@
}
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;
}
}
« no previous file with comments | « chrome/browser/instant/instant_controller.h ('k') | chrome/browser/instant/instant_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698