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

Unified Diff: chrome/browser/ui/omnibox/omnibox_edit_model.cc

Issue 11876045: [Search] Store and recall search terms using NavigationEntry to improve search term extraction (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed comments Created 7 years, 11 months 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
Index: chrome/browser/ui/omnibox/omnibox_edit_model.cc
diff --git a/chrome/browser/ui/omnibox/omnibox_edit_model.cc b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
index b26a1d142389302493303aeffb306e383a67d1ec..739a495fa76638bd5c2c6be50e7b2e524cd24c0f 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
@@ -660,6 +660,15 @@ void OmniboxEditModel::OpenMatch(const AutocompleteMatch& match,
if (disposition != NEW_BACKGROUND_TAB) {
base::AutoReset<bool> tmp(&in_revert_, true);
view_->RevertAll(); // Revert the box to its unedited state
+ if (controller()->GetInstant() &&
+ controller()->GetInstant()->IsInstantExtendedSearch()) {
+ // In the case of an instant-extended search, actually revert to
+ // |last_omnibox_text|, which is what the user is searching for. This
+ // avoids a flash of the previous query.
+ view_->OnTemporaryTextMaybeChanged(
+ controller()->GetInstant()->last_omnibox_text(),
+ true);
+ }
sreeram 2013/01/22 04:34:47 I see what you are trying to do here, but I'd like
}
if (match.type == AutocompleteMatch::EXTENSION_APP) {

Powered by Google App Engine
This is Rietveld 408576698