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

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: one final pass through the code Created 7 years, 5 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 e831193fd3c86d59f6fa9bdc39aec0ba193f6e0d..7ba3150800e72c046152ce9caf551606fb30fef2 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_autocomplete_offset (to allow inline
// autocompletion) here, it's surprising and annoying.
@@ -1059,8 +1060,10 @@ AutocompleteMatch HistoryURLProvider::HistoryMatchToACMatch(
net::FormatUrl(info.url(), languages, format_types,
net::UnescapeRule::SPACES, NULL, NULL,
&inline_autocomplete_offset));
- if (!params->prevent_inline_autocomplete)
+ if (!params->prevent_inline_autocomplete) {
+ match.allowed_to_be_default_match = true;
match.inline_autocomplete_offset = inline_autocomplete_offset;
+ }
DCHECK((match.inline_autocomplete_offset == string16::npos) ||
(match.inline_autocomplete_offset <= match.fill_into_edit.length()));

Powered by Google App Engine
This is Rietveld 408576698