Chromium Code Reviews

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

Issue 6044006: Remove wstring from l10n_util. Part 3.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: chrome/browser/autocomplete/keyword_provider.cc
===================================================================
--- chrome/browser/autocomplete/keyword_provider.cc (revision 70263)
+++ 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()),
viettrungluu 2010/12/29 19:04:15 Nit: this line (and the next) should probably be i
Avi (use Gerrit) 2010/12/29 19:40:49 Done.
+ 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(
viettrungluu 2010/12/29 19:04:15 Was there a particular reason for getting rid of t
Avi (use Gerrit) 2010/12/29 19:40:49 Statics are evil. You're not allowed to use them.
+ 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') | chrome/browser/extensions/extensions_startup.cc » ('J')

Powered by Google App Engine