| 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..a54fa5b948ced08377ecbd5e0bdf8a2b1f6c0167 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() &&
|
| + controller()->GetInstant()->IsInstantExtendedSearch();
|
| + 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;
|
|
|