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, 11 insertions, 0 deletions
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc
index c7b7494..4949783 100644
--- a/chrome/browser/instant/instant_controller.cc
+++ b/chrome/browser/instant/instant_controller.cc
@@ -234,7 +234,18 @@ bool InstantController::IsCurrent() {
void InstantController::CommitCurrentPreview(InstantCommitType type) {
DCHECK(loader_manager_.get());
DCHECK(loader_manager_->current_loader());
+ bool showing_instant =
+ loader_manager_->current_loader()->is_showing_instant();
TabContentsWrapper* tab = ReleasePreviewContents(type);
+ // If the loader was showing an instant page then it's navigation stack is
+ // something like: search-engine-home-page (eg google.com) search-term1
+ // search-term2 .... Each search-term navigation corresponds to the page
+ // deciding enough time has passed to commit a navigation. We don't want the
+ // searche-engine-home-page navigation in this case so we pass true to
+ // CopyStateFromAndPrune to have the search-engine-home-page navigation
+ // removed.
+ tab->controller().CopyStateFromAndPrune(
+ &tab_contents_->controller(), showing_instant);
delegate_->CommitInstant(tab);
CompleteRelease(tab->tab_contents());
}