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

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

Issue 19197005: Omnibox: Change |inline_autocomplete_offset| to |inline_autocompletion| (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: drop user_text() in omnibox_edit_model 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..824cee6e928cb94957d93547ab6612a0357027f7 100644
--- a/chrome/browser/autocomplete/history_url_provider.cc
+++ b/chrome/browser/autocomplete/history_url_provider.cc
@@ -349,8 +349,8 @@ AutocompleteMatch HistoryURLProvider::SuggestExactInput(
match.fill_into_edit =
AutocompleteInput::FormattedStringWithEquivalentMeaning(url,
display_string);
- // NOTE: Don't set match.inline_autocomplete_offset (to allow inline
- // autocompletion) here, it's surprising and annoying.
+ // NOTE: Don't set match.inline_autocompletion to something non-empty here;
+ // it's surprising and annoying.
// Try to highlight "innermost" match location. If we fix up "w" into
// "www.w.com", we want to highlight the fifth character, not the first.
@@ -1059,10 +1059,12 @@ AutocompleteMatch HistoryURLProvider::HistoryMatchToACMatch(
net::FormatUrl(info.url(), languages, format_types,
net::UnescapeRule::SPACES, NULL, NULL,
&inline_autocomplete_offset));
- if (!params->prevent_inline_autocomplete)
- match.inline_autocomplete_offset = inline_autocomplete_offset;
- DCHECK((match.inline_autocomplete_offset == string16::npos) ||
- (match.inline_autocomplete_offset <= match.fill_into_edit.length()));
+ if (!params->prevent_inline_autocomplete &&
+ (inline_autocomplete_offset != string16::npos)) {
+ DCHECK(inline_autocomplete_offset <= match.fill_into_edit.length());
+ match.inline_autocompletion =
+ match.fill_into_edit.substr(inline_autocomplete_offset);
+ }
size_t match_start = history_match.input_location;
match.contents = net::FormatUrl(info.url(), languages,

Powered by Google App Engine
This is Rietveld 408576698