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

Unified Diff: chrome/browser/autocomplete/history_quick_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_quick_provider.cc
diff --git a/chrome/browser/autocomplete/history_quick_provider.cc b/chrome/browser/autocomplete/history_quick_provider.cc
index 073aa18ec4ddca9f23dd425d7c68a4e0f1378283..1a083a288fe4c4004d82a47ca025554f84a8f58f 100644
--- a/chrome/browser/autocomplete/history_quick_provider.cc
+++ b/chrome/browser/autocomplete/history_quick_provider.cc
@@ -272,17 +272,17 @@ AutocompleteMatch HistoryQuickProvider::QuickMatchToACMatch(
match.contents_class =
SpansFromTermMatch(new_matches, match.contents.length(), true);
- if (!history_match.can_inline) {
- match.inline_autocomplete_offset = string16::npos;
- } else {
+ if (history_match.can_inline) {
DCHECK(!new_matches.empty());
- match.inline_autocomplete_offset = new_matches[0].offset +
+ size_t inline_autocomplete_offset = new_matches[0].offset +
new_matches[0].length;
// The following will happen if the user has typed an URL with a scheme
// and the last character typed is a slash because that slash is removed
// by the FormatURLWithOffsets call above.
- if (match.inline_autocomplete_offset > match.fill_into_edit.length())
- match.inline_autocomplete_offset = match.fill_into_edit.length();
+ if (inline_autocomplete_offset > match.fill_into_edit.length())
Peter Kasting 2013/07/16 18:09:05 Nit: How about just: if (inline_autocomplete_
Mark P 2013/07/16 18:53:23 Good idea. Don't know how I missed seeing that si
+ inline_autocomplete_offset = match.fill_into_edit.length();
+ match.inline_autocompletion =
+ match.fill_into_edit.substr(inline_autocomplete_offset);
}
// Format the description autocomplete presentation.

Powered by Google App Engine
This is Rietveld 408576698