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

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

Issue 11415292: [Search] No longer reverting omnibox text on instant search (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: indent Created 8 years 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 698fba63810c25971a46ea5f19297955ebca1fb1..ea0a2faba4e8f7a78242b65d2ec2f07cbc0216aa 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
@@ -627,7 +627,17 @@ void OmniboxEditModel::OpenMatch(const AutocompleteMatch& match,
TemplateURLPrepopulateData::kMaxPrepopulatedEngineID);
}
- if (disposition != NEW_BACKGROUND_TAB) {
+ // Text in the omnibox needs to be reverted in the following cases:
+ // (1) Non-instant-extended query is committed (except to a background tab,
+ // where the query stays in the omnibox e.g. middle-click).
+ // (2) Instant-extended query is committed on a new tab (foreground or
+ // background). Current tab should show previous, reverted query.
+ bool is_instant_extended_search =
+ controller()->GetInstant()->IsInstantExtendedSearch();
sky 2012/12/12 22:41:57 null check GetInstant()
Mathieu 2012/12/12 23:37:24 Done.
+ if ((disposition != NEW_BACKGROUND_TAB && !is_instant_extended_search) ||
+ (is_instant_extended_search &&
+ (disposition == NEW_BACKGROUND_TAB ||
+ disposition == NEW_FOREGROUND_TAB))) {
in_revert_ = true;
view_->RevertAll(); // Revert the box to its unedited state
in_revert_ = false;

Powered by Google App Engine
This is Rietveld 408576698