Chromium Code Reviews| 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. |