Commit 622e2ed8 authored by jdonnelly's avatar jdonnelly Committed by Commit bot

Compare case insensitively when copying answers into verbatim matches.

This avoids the case where an available answer is not shown because of a case mismatch (e.g. "US population" vs. "us population").

BUG=563621

Review URL: https://codereview.chromium.org/1543803004

Cr-Commit-Position: refs/heads/master@{#367085}
parent 9c4f52cb
...@@ -928,9 +928,12 @@ void SearchProvider::ConvertResultsToAutocompleteMatches() { ...@@ -928,9 +928,12 @@ void SearchProvider::ConvertResultsToAutocompleteMatches() {
base::string16 answer_contents; base::string16 answer_contents;
base::string16 answer_type; base::string16 answer_type;
scoped_ptr<SuggestionAnswer> answer; scoped_ptr<SuggestionAnswer> answer;
base::string16 trimmed_verbatim_lower =
base::i18n::ToLower(trimmed_verbatim);
for (ACMatches::iterator it = matches_.begin(); it != matches_.end(); for (ACMatches::iterator it = matches_.begin(); it != matches_.end();
++it) { ++it) {
if (it->answer && it->fill_into_edit == trimmed_verbatim) { if (it->answer &&
base::i18n::ToLower(it->fill_into_edit) == trimmed_verbatim_lower) {
answer_contents = it->answer_contents; answer_contents = it->answer_contents;
answer_type = it->answer_type; answer_type = it->answer_type;
answer = SuggestionAnswer::copy(it->answer.get()); answer = SuggestionAnswer::copy(it->answer.get());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment