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

Unified Diff: chrome/browser/autocomplete/keyword_provider.cc

Issue 6051012: Revert 70271 - Remove wstring from l10n_util. Part 3.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years 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 | chrome/browser/autocomplete/search_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/keyword_provider.cc
===================================================================
--- chrome/browser/autocomplete/keyword_provider.cc (revision 70280)
+++ chrome/browser/autocomplete/keyword_provider.cc (working copy)
@@ -318,10 +318,9 @@
if (element->url()->SupportsReplacement() &&
!element->IsExtensionKeyword()) {
// No query input; return a generic, no-destination placeholder.
- match->contents.assign(UTF16ToWideHack(
- l10n_util::GetStringFUTF16(message_id,
- WideToUTF16Hack(element->AdjustedShortNameForLocaleDirection()),
- l10n_util::GetStringUTF16(IDS_EMPTY_KEYWORD_VALUE))));
+ match->contents.assign(l10n_util::GetStringF(message_id,
+ element->AdjustedShortNameForLocaleDirection(),
+ l10n_util::GetString(IDS_EMPTY_KEYWORD_VALUE)));
match->contents_class.push_back(
ACMatchClassification(0, ACMatchClassification::DIM));
} else {
@@ -342,11 +341,10 @@
*element, remaining_input, TemplateURLRef::NO_SUGGESTIONS_AVAILABLE,
std::wstring()));
std::vector<size_t> content_param_offsets;
- match->contents.assign(UTF16ToWideHack(
- l10n_util::GetStringFUTF16(message_id,
- WideToUTF16Hack(element->short_name()),
- WideToUTF16Hack(remaining_input),
- &content_param_offsets)));
+ match->contents.assign(l10n_util::GetStringF(message_id,
+ element->short_name(),
+ remaining_input,
+ &content_param_offsets));
if (content_param_offsets.size() == 2) {
AutocompleteMatch::ClassifyLocationInString(content_param_offsets[1],
remaining_input.length(), match->contents.length(),
@@ -422,16 +420,15 @@
// Create popup entry description based on the keyword name.
if (!element->IsExtensionKeyword()) {
- result.description.assign(UTF16ToWideHack(l10n_util::GetStringFUTF16(
- IDS_AUTOCOMPLETE_KEYWORD_DESCRIPTION, WideToUTF16Hack(keyword))));
- string16 keyword_desc(
- l10n_util::GetStringUTF16(IDS_AUTOCOMPLETE_KEYWORD_DESCRIPTION));
- AutocompleteMatch::ClassifyLocationInString(
- keyword_desc.find(ASCIIToUTF16("%s")),
- prefix_length,
- result.description.length(),
- ACMatchClassification::DIM,
- &result.description_class);
+ result.description.assign(l10n_util::GetStringF(
+ IDS_AUTOCOMPLETE_KEYWORD_DESCRIPTION, keyword));
+ static const std::wstring kKeywordDesc(
+ l10n_util::GetString(IDS_AUTOCOMPLETE_KEYWORD_DESCRIPTION));
+ AutocompleteMatch::ClassifyLocationInString(kKeywordDesc.find(L"%s"),
+ prefix_length,
+ result.description.length(),
+ ACMatchClassification::DIM,
+ &result.description_class);
}
return result;
« no previous file with comments | « no previous file | chrome/browser/autocomplete/search_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698