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

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

Issue 5989012: Revert 70281 - 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 70282)
+++ chrome/browser/autocomplete/keyword_provider.cc (working copy)
@@ -318,9 +318,10 @@
if (element->url()->SupportsReplacement() &&
!element->IsExtensionKeyword()) {
// No query input; return a generic, no-destination placeholder.
- match->contents.assign(l10n_util::GetStringF(message_id,
- element->AdjustedShortNameForLocaleDirection(),
- l10n_util::GetString(IDS_EMPTY_KEYWORD_VALUE)));
+ match->contents.assign(UTF16ToWideHack(
+ l10n_util::GetStringFUTF16(message_id,
+ WideToUTF16Hack(element->AdjustedShortNameForLocaleDirection()),
+ l10n_util::GetStringUTF16(IDS_EMPTY_KEYWORD_VALUE))));
match->contents_class.push_back(
ACMatchClassification(0, ACMatchClassification::DIM));
} else {
@@ -341,10 +342,11 @@
*element, remaining_input, TemplateURLRef::NO_SUGGESTIONS_AVAILABLE,
std::wstring()));
std::vector<size_t> content_param_offsets;
- match->contents.assign(l10n_util::GetStringF(message_id,
- element->short_name(),
- remaining_input,
- &content_param_offsets));
+ match->contents.assign(UTF16ToWideHack(
+ l10n_util::GetStringFUTF16(message_id,
+ WideToUTF16Hack(element->short_name()),
+ WideToUTF16Hack(remaining_input),
+ &content_param_offsets)));
if (content_param_offsets.size() == 2) {
AutocompleteMatch::ClassifyLocationInString(content_param_offsets[1],
remaining_input.length(), match->contents.length(),
@@ -420,15 +422,16 @@
// Create popup entry description based on the keyword name.
if (!element->IsExtensionKeyword()) {
- 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);
+ 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);
}
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