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

Unified Diff: components/omnibox/browser/keyword_provider.cc

Issue 1784233003: Omnibox - Keyword Provider Shouldn't Bold What-You-Typed Queries (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update test Created 4 years, 9 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
« no previous file with comments | « no previous file | components/omnibox/browser/keyword_provider_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/omnibox/browser/keyword_provider.cc
diff --git a/components/omnibox/browser/keyword_provider.cc b/components/omnibox/browser/keyword_provider.cc
index e4e21b3d3f7267cc15e8c2162b1f3f4f4120c489..8573dfef720762b2e83bd7bee042fb2a716ab9ac 100644
--- a/components/omnibox/browser/keyword_provider.cc
+++ b/components/omnibox/browser/keyword_provider.cc
@@ -449,8 +449,6 @@ void KeywordProvider::FillInURLAndContents(
DCHECK(!element->short_name().empty());
const TemplateURLRef& element_ref = element->url_ref();
DCHECK(element_ref.IsValid(GetTemplateURLService()->search_terms_data()));
- int message_id = (element->GetType() == TemplateURL::OMNIBOX_API_EXTENSION) ?
- IDS_EXTENSION_KEYWORD_COMMAND : IDS_KEYWORD_SEARCH;
if (remaining_input.empty()) {
// Allow extension keyword providers to accept empty string input. This is
// useful to allow extensions to do something in the case where no input is
@@ -460,13 +458,15 @@ void KeywordProvider::FillInURLAndContents(
(element->GetType() != TemplateURL::OMNIBOX_API_EXTENSION)) {
// No query input; return a generic, no-destination placeholder.
match->contents.assign(
- l10n_util::GetStringFUTF16(message_id,
+ l10n_util::GetStringFUTF16(
+ IDS_KEYWORD_SEARCH,
element->AdjustedShortNameForLocaleDirection(),
l10n_util::GetStringUTF16(IDS_EMPTY_KEYWORD_VALUE)));
Peter Kasting 2016/03/17 06:08:11 Should we change this to just "<enter query> - Ama
Mark P 2016/04/01 21:48:39 Changed text per the bug.
match->contents_class.push_back(
ACMatchClassification(0, ACMatchClassification::DIM));
} else {
- // Keyword that has no replacement text (aka a shorthand for a URL).
+ // Keyword or extension that has no replacement text (aka a shorthand for
+ // a URL).
match->destination_url = GURL(element->url());
match->contents.assign(element->short_name());
AutocompleteMatch::ClassifyLocationInString(0, match->contents.length(),
@@ -485,15 +485,9 @@ void KeywordProvider::FillInURLAndContents(
element == GetTemplateURLService()->GetDefaultSearchProvider();
match->destination_url = GURL(element_ref.ReplaceSearchTerms(
search_terms_args, GetTemplateURLService()->search_terms_data()));
- std::vector<size_t> content_param_offsets;
- match->contents.assign(l10n_util::GetStringFUTF16(message_id,
- element->short_name(),
- remaining_input,
- &content_param_offsets));
- DCHECK_EQ(2U, content_param_offsets.size());
- AutocompleteMatch::ClassifyLocationInString(content_param_offsets[1],
- remaining_input.length(), match->contents.length(),
- ACMatchClassification::NONE, &match->contents_class);
+ match->contents = remaining_input;
+ match->contents_class.push_back(
+ ACMatchClassification(0, ACMatchClassification::NONE));
}
}
« no previous file with comments | « no previous file | components/omnibox/browser/keyword_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698