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

Unified Diff: chrome/browser/tab_contents/render_view_context_menu.cc

Issue 126223: Replace std:;wstring with std::string in locale-name related APIs.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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
Index: chrome/browser/tab_contents/render_view_context_menu.cc
===================================================================
--- chrome/browser/tab_contents/render_view_context_menu.cc (revision 19124)
+++ chrome/browser/tab_contents/render_view_context_menu.cc (working copy)
@@ -84,7 +84,8 @@
if (params_.link_url.SchemeIs(chrome::kMailToScheme)) {
AppendMenuItem(IDS_CONTENT_CONTEXT_COPYLINKLOCATION,
- l10n_util::GetString(IDS_CONTENT_CONTEXT_COPYEMAILADDRESS));
+ l10n_util::GetStringUTF16(
+ IDS_CONTENT_CONTEXT_COPYEMAILADDRESS));
} else {
AppendMenuItem(IDS_CONTENT_CONTEXT_COPYLINKLOCATION);
}
@@ -136,9 +137,10 @@
std::wstring selection_text =
l10n_util::TruncateString(params_.selection_text, 50);
if (!selection_text.empty()) {
- std::wstring label(l10n_util::GetStringF(IDS_CONTENT_CONTEXT_SEARCHWEBFOR,
- default_provider->short_name(),
- selection_text));
+ string16 label(WideToUTF16(
+ l10n_util::GetStringF(IDS_CONTENT_CONTEXT_SEARCHWEBFOR,
+ default_provider->short_name(),
+ selection_text)));
AppendMenuItem(IDS_CONTENT_CONTEXT_SEARCHWEBFOR, label);
}
}
@@ -150,7 +152,7 @@
IDC_SPELLCHECK_SUGGESTION_0 + i <= IDC_SPELLCHECK_SUGGESTION_LAST;
++i) {
AppendMenuItem(IDC_SPELLCHECK_SUGGESTION_0 + static_cast<int>(i),
- params_.dictionary_suggestions[i]);
+ WideToUTF16(params_.dictionary_suggestions[i]));
}
if (params_.dictionary_suggestions.size() > 0)
AppendSeparator();
@@ -159,7 +161,8 @@
if (!params_.misspelled_word.empty()) {
if (params_.dictionary_suggestions.size() == 0) {
AppendMenuItem(0,
- l10n_util::GetString(IDS_CONTENT_CONTEXT_NO_SPELLING_SUGGESTIONS));
+ l10n_util::GetStringUTF16(
+ IDS_CONTENT_CONTEXT_NO_SPELLING_SUGGESTIONS));
}
AppendMenuItem(IDS_CONTENT_CONTEXT_ADD_TO_DICTIONARY);
AppendSeparator();
@@ -176,19 +179,19 @@
// Add Spell Check options sub menu.
StartSubMenu(IDC_SPELLCHECK_MENU,
- l10n_util::GetString(IDS_CONTENT_CONTEXT_SPELLCHECK_MENU));
+ l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_SPELLCHECK_MENU));
// Add Spell Check languages to sub menu.
- SpellChecker::Languages display_languages;
+ SpellChecker::Languages spellcheck_languages;
SpellChecker::GetSpellCheckLanguages(profile_,
- &display_languages);
- DCHECK(display_languages.size() <
+ &spellcheck_languages);
+ DCHECK(spellcheck_languages.size() <
IDC_SPELLCHECK_LANGUAGES_LAST - IDC_SPELLCHECK_LANGUAGES_FIRST);
- const std::wstring app_locale = g_browser_process->GetApplicationLocale();
- for (size_t i = 0; i < display_languages.size(); ++i) {
- std::wstring local_language(l10n_util::GetLocalName(
- display_languages[i], app_locale, true));
- AppendRadioMenuItem(IDC_SPELLCHECK_LANGUAGES_FIRST + i, local_language);
+ const std::string app_locale = g_browser_process->GetApplicationLocale();
+ for (size_t i = 0; i < spellcheck_languages.size(); ++i) {
+ string16 display_name(l10n_util::GetDisplayNameForLocale(
+ spellcheck_languages[i], app_locale, true));
+ AppendRadioMenuItem(IDC_SPELLCHECK_LANGUAGES_FIRST + i, display_name);
}
// Add item in the sub menu to pop up the fonts and languages options menu.
@@ -198,7 +201,8 @@
// Add 'Check the spelling of this field' item in the sub menu.
AppendCheckboxMenuItem(
IDC_CHECK_SPELLING_OF_THIS_FIELD,
- l10n_util::GetString(IDS_CONTENT_CONTEXT_CHECK_SPELLING_OF_THIS_FIELD));
+ l10n_util::GetStringUTF16(
+ IDS_CONTENT_CONTEXT_CHECK_SPELLING_OF_THIS_FIELD));
FinishSubMenu();
« no previous file with comments | « chrome/browser/tab_contents/render_view_context_menu.h ('k') | chrome/browser/tab_contents/render_view_context_menu_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698