diff options
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r-- | chrome/browser/autocomplete/keyword_provider.cc | 11 | ||||
-rw-r--r-- | chrome/browser/autocomplete/keyword_provider.h | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/chrome/browser/autocomplete/keyword_provider.cc b/chrome/browser/autocomplete/keyword_provider.cc index 1e68de5..4238a89 100644 --- a/chrome/browser/autocomplete/keyword_provider.cc +++ b/chrome/browser/autocomplete/keyword_provider.cc @@ -339,7 +339,7 @@ int KeywordProvider::CalculateRelevance(AutocompleteInput::Type type, AutocompleteMatch KeywordProvider::CreateAutocompleteMatch( TemplateURLModel* model, - const std::wstring keyword, + const std::wstring& keyword, const AutocompleteInput& input, size_t prefix_length, const std::wstring& remaining_input, @@ -369,9 +369,12 @@ AutocompleteMatch KeywordProvider::CreateAutocompleteMatch( if (!remaining_input.empty() || !keyword_complete || supports_replacement) result.fill_into_edit.push_back(L' '); result.fill_into_edit.append(remaining_input); - if (!input.prevent_inline_autocomplete() && - (keyword_complete || remaining_input.empty())) - result.inline_autocomplete_offset = input.text().length(); + // If we wanted to set |result.inline_autocomplete_offset| correctly, we'd + // need CleanUserInputKeyword() to return the amount of adjustment it's made + // to the user's input. Because right now inexact keyword matches can't score + // more highly than a "what you typed" match from one of the other providers, + // we just don't bother to do this, and leave inline autocompletion off. + result.inline_autocomplete_offset = std::wstring::npos; // Create destination URL and popup entry content by substituting user input // into keyword templates. diff --git a/chrome/browser/autocomplete/keyword_provider.h b/chrome/browser/autocomplete/keyword_provider.h index 9f7de95..056d47b 100644 --- a/chrome/browser/autocomplete/keyword_provider.h +++ b/chrome/browser/autocomplete/keyword_provider.h @@ -112,7 +112,7 @@ class KeywordProvider : public AutocompleteProvider, // If |relevance| is negative, calculate a relevance based on heuristics. AutocompleteMatch CreateAutocompleteMatch( TemplateURLModel* model, - const std::wstring keyword, + const std::wstring& keyword, const AutocompleteInput& input, size_t prefix_length, const std::wstring& remaining_input, |