diff options
-rw-r--r-- | chrome/browser/instant/instant_controller.cc | 3 | ||||
-rw-r--r-- | chrome/browser/ui/browser.cc | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc index ed01fc5..fffe5db 100644 --- a/chrome/browser/instant/instant_controller.cc +++ b/chrome/browser/instant/instant_controller.cc @@ -224,7 +224,8 @@ void InstantController::DestroyPreviewContents() { } // ReleasePreviewContents sets is_active_ to false, but we need to set it - // beore notifying the delegate so. + // before notifying the delegate, otherwise if the delegate asks for the state + // we'll still be active. is_active_ = false; delegate_->HideInstant(); delete ReleasePreviewContents(INSTANT_COMMIT_DESTROY); diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 8d33464..aa3b271 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -4170,9 +4170,11 @@ bool Browser::OpenInstant(WindowOpenDisposition disposition) { return true; } if (disposition == NEW_FOREGROUND_TAB || disposition == NEW_BACKGROUND_TAB) { - HideInstant(); TabContentsWrapper* preview_contents = instant()->ReleasePreviewContents( INSTANT_COMMIT_PRESSED_ENTER); + // HideInstant is invoked after release so that InstantController is not + // active when HideInstant asks it for its state. + HideInstant(); preview_contents->controller().PruneAllButActive(); tab_handler_->GetTabStripModel()->AddTabContents( preview_contents, |