diff options
author | shishir@chromium.org <shishir@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-27 05:39:54 +0000 |
---|---|---|
committer | shishir@chromium.org <shishir@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-27 05:39:54 +0000 |
commit | fabb4d9011cf99e76c7642db383f479be68b6518 (patch) | |
tree | ef32f13c7a8d4aa80f30baa629a7730f7087469c | |
parent | 12075d18817f463f954cdb5f6d51f3ac7ecc498a (diff) | |
download | chromium_src-fabb4d9011cf99e76c7642db383f479be68b6518.zip chromium_src-fabb4d9011cf99e76c7642db383f479be68b6518.tar.gz chromium_src-fabb4d9011cf99e76c7642db383f479be68b6518.tar.bz2 |
InstantExtended: Add transient entries after pruning the Nav entries.
BUG=178303
Review URL: https://chromiumcodereview.appspot.com/12328126
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184888 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/instant/instant_controller.cc | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc index 4af5bc7..c6293512 100644 --- a/chrome/browser/instant/instant_controller.cc +++ b/chrome/browser/instant/instant_controller.cc @@ -609,21 +609,6 @@ bool InstantController::CommitIfPossible(InstantCommitType type) { scoped_ptr<content::WebContents> preview = overlay_->ReleaseContents(); - if (extended_enabled_) { - // Adjust the search terms shown in the omnibox for this query. Hitting - // ENTER searches for what the user typed, so use last_omnibox_text_. - // Clicking on the overlay commits what is currently showing, so add in the - // gray text in that case. - if (type == INSTANT_COMMIT_FOCUS_LOST && - last_suggestion_.behavior == INSTANT_COMPLETE_NEVER) { - // Update |last_omnibox_text_| so that the controller commits the proper - // query if the user focuses the omnibox and presses Enter. - last_omnibox_text_ += last_suggestion_.text; - } - - EnsureSearchTermsAreSet(preview.get(), last_omnibox_text_); - } - // If the preview page has navigated since the last Update(), we need to add // the navigation to history ourselves. Else, the page will navigate after // commit, and it will be added to history in the usual manner. @@ -670,6 +655,21 @@ bool InstantController::CommitIfPossible(InstantCommitType type) { &active_tab->GetController()); } + if (extended_enabled_) { + // Adjust the search terms shown in the omnibox for this query. Hitting + // ENTER searches for what the user typed, so use last_omnibox_text_. + // Clicking on the overlay commits what is currently showing, so add in the + // gray text in that case. + if (type == INSTANT_COMMIT_FOCUS_LOST && + last_suggestion_.behavior == INSTANT_COMPLETE_NEVER) { + // Update |last_omnibox_text_| so that the controller commits the proper + // query if the user focuses the omnibox and presses Enter. + last_omnibox_text_ += last_suggestion_.text; + } + + EnsureSearchTermsAreSet(preview.get(), last_omnibox_text_); + } + // Save notification source before we release the preview. content::Source<content::WebContents> notification_source(preview.get()); |