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

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: fix issue with using a reference in a place we shouldn't 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..535fd5fb4d1f45db0e6b841ab5e8f1fe7c4ce00e 100644
--- a/chrome/browser/autocomplete/history_url_provider.cc
+++ b/chrome/browser/autocomplete/history_url_provider.cc
@@ -349,7 +349,7 @@ AutocompleteMatch HistoryURLProvider::SuggestExactInput(
match.fill_into_edit =
AutocompleteInput::FormattedStringWithEquivalentMeaning(url,
display_string);
- // NOTE: Don't set match.inline_autocomplete_offset (to allow inline
+ // NOTE: Don't set match.inline_autocompletion (to allow inline
// autocompletion) here, it's surprising and annoying.
Peter Kasting 2013/07/16 18:09:05 Nit: How about: NOTE: Don't set match.inline_auto
Mark P 2013/07/16 18:53:23 Done.
// Try to highlight "innermost" match location. If we fix up "w" into
@@ -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