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

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

Issue 1072163003: Make GetInfoForCurrentText() return the correct match when we've selected an (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments Created 5 years, 8 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 dcbdd8a8e9809e02cd7735b31b209b0de9d8ee8a..49ca25db20f1b9e1c7ca0e7afd94bb28ff83d252 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
@@ -1375,7 +1375,11 @@ void OmniboxEditModel::GetInfoForCurrentText(AutocompleteMatch* match,
// have gotten here.
CHECK(!result().empty());
CHECK(popup_model()->selected_line() < result().size());
- *match = result().match_at(popup_model()->selected_line());
+ const AutocompleteMatch& selected_match =
+ result().match_at(popup_model()->selected_line());
+ *match =
+ (popup_model()->selected_line_state() == OmniboxPopupModel::KEYWORD) ?
+ *selected_match.associated_keyword : selected_match;
}
if (alternate_nav_url &&
(!popup_model() || popup_model()->manually_selected_match().empty()))
« no previous file with comments | « no previous file | chrome/browser/ui/omnibox/omnibox_popup_model.h » ('j') | chrome/browser/ui/omnibox/omnibox_popup_model.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698