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

Unified Diff: chrome/browser/autocomplete/history_url_provider.cc

Issue 18878007: Omnibox: Make the Controller Reorder Matches for Inlining (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Harry's comments Created 7 years, 4 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/autocomplete/history_url_provider.cc
diff --git a/chrome/browser/autocomplete/history_url_provider.cc b/chrome/browser/autocomplete/history_url_provider.cc
index 18e8f27a3830321757209d55d5fdec81f7b5717a..81f3704ff7db8772f8985c14ee1c229ec9692482 100644
--- a/chrome/browser/autocomplete/history_url_provider.cc
+++ b/chrome/browser/autocomplete/history_url_provider.cc
@@ -349,6 +349,7 @@ AutocompleteMatch HistoryURLProvider::SuggestExactInput(
match.fill_into_edit =
AutocompleteInput::FormattedStringWithEquivalentMeaning(url,
display_string);
+ match.allowed_to_be_default_match = true;
// NOTE: Don't set match.inline_autocompletion to something non-empty here;
// it's surprising and annoying.
@@ -1065,6 +1066,10 @@ AutocompleteMatch HistoryURLProvider::HistoryMatchToACMatch(
match.inline_autocompletion =
match.fill_into_edit.substr(inline_autocomplete_offset);
}
+ match.allowed_to_be_default_match = !params->prevent_inline_autocomplete ?
Peter Kasting 2013/08/06 22:56:16 Nit: Simpler: match.allowed_to_be_default_match
Mark P 2013/08/07 00:44:31 Nice. Done.
+ true :
+ ((inline_autocomplete_offset != string16::npos) &&
+ (inline_autocomplete_offset >= match.fill_into_edit.length()));
size_t match_start = history_match.input_location;
match.contents = net::FormatUrl(info.url(), languages,

Powered by Google App Engine
This is Rietveld 408576698