summaryrefslogtreecommitdiffstats
path: root/chrome/browser/instant/instant_controller.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/instant/instant_controller.cc')
-rw-r--r--chrome/browser/instant/instant_controller.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
index 50f833b..c7b7494 100644
--- a/chrome/browser/instant/instant_controller.cc
+++ b/chrome/browser/instant/instant_controller.cc
@@ -425,12 +425,15 @@ void InstantController::InstantLoaderDoesntSupportInstant(
// 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, hide all.
+ // Because of the state of the stack we can't destroy the loader now.
+ bool was_pending = loader_manager_->pending_loader() == loader;
+ ScheduleDestroy(loader_manager_->ReleaseLoader(loader));
+ if (was_pending) {
+ // |loader| was the pending loader. We may be showing another TabContents to
+ // the user (what was current). Destroy it.
DestroyPreviewContentsAndLeaveActive();
} else {
- scoped_ptr<InstantLoader> owned_loader(
- loader_manager_->ReleaseLoader(loader));
+ // |loader| wasn't pending, yet it may still be the displayed loader.
UpdateDisplayableLoader();
}
}