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

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: Gutted 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
« no previous file with comments | « chrome/browser/instant/instant_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 507cf65f7607a73e37b5aaf18539d81a6ec9ac27..4dff69e6258f21a1682bdd341b0152b180d78f32 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
@@ -629,7 +629,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() &&
+ controller()->GetInstant()->IsInstantExtendedSearch();
+ if ((disposition != NEW_BACKGROUND_TAB && !is_instant_extended_search) ||
+ (is_instant_extended_search &&
+ (disposition == NEW_BACKGROUND_TAB ||
+ disposition == NEW_FOREGROUND_TAB))) {
base::AutoReset<bool> tmp(&in_revert_, true);
view_->RevertAll(); // Revert the box to its unedited state
}
« no previous file with comments | « chrome/browser/instant/instant_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698