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

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: Peter's comments 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;
msw 2013/07/18 06:23:57 How does this relate to the seemingly contradictor
Peter Kasting 2013/07/18 17:35:28 We do want the match to be default, we just don't
msw 2013/07/18 17:46:53 Ah, thanks for clarifying.
// 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;
msw 2013/07/18 06:23:57 Should this only be true is inline_autocomplete_of
Peter Kasting 2013/07/18 17:35:28 I don't think so but I'm not actually sure.
Mark P 2013/07/21 20:31:05 I think the current code is right: HistoryURL pro
msw 2013/07/23 21:55:32 It looks like you took my suggestion in r212693 an
Mark P 2013/07/26 16:48:13 Thought more; revised this code.
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