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

Unified Diff: chrome/browser/views/options/languages_page_view.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/views/options/languages_page_view.cc
===================================================================
--- chrome/browser/views/options/languages_page_view.cc (revision 19124)
+++ chrome/browser/views/options/languages_page_view.cc (working copy)
@@ -291,17 +291,18 @@
void AddLanguageWindowView::Init() {
// Determine Locale Codes.
std::vector<std::string> locale_codes;
- const std::wstring app_locale = g_browser_process->GetApplicationLocale();
+ const std::string app_locale = g_browser_process->GetApplicationLocale();
for (size_t i = 0; i < arraysize(accept_language_list); ++i) {
- std::wstring local_name =
- l10n_util::GetLocalName(accept_language_list[i], app_locale, false);
+ string16 display_name =
+ l10n_util::GetDisplayNameForLocale(accept_language_list[i],
+ app_locale, false);
// This is a hack. If ICU doesn't have a translated name for
- // this language, GetLocalName will just return the language code.
- // In that case, we skip it.
+ // this language, GetDisplayNameForLocale will just return the
+ // language code. In that case, we skip it.
// TODO(jungshik) : Put them at the of the list with language codes
// enclosed by brackets.
- if (IsStringASCII(local_name) &&
- WideToASCII(local_name) == accept_language_list[i])
+ if (IsStringASCII(display_name) &&
+ UTF16ToASCII(display_name) == accept_language_list[i])
continue;
locale_codes.push_back(accept_language_list[i]);
}
@@ -381,8 +382,10 @@
std::wstring LanguageOrderTableModel::GetText(int row, int column_id) {
DCHECK(row >= 0 && row < RowCount());
- const std::wstring app_locale = g_browser_process->GetApplicationLocale();
- return l10n_util::GetLocalName(languages_.at(row), app_locale, true);
+ const std::string app_locale = g_browser_process->GetApplicationLocale();
+ return l10n_util::GetDisplayNameForLocale(languages_.at(row),
+ app_locale,
+ true);
}
void LanguageOrderTableModel::Add(const std::string& language) {
@@ -702,7 +705,7 @@
// The pref value for locale isn't valid. Use the current app locale
// (which is what we're currently using).
index = ui_language_model_->GetIndexFromLocale(
- WideToASCII(g_browser_process->GetApplicationLocale()));
+ g_browser_process->GetApplicationLocale());
}
DCHECK(-1 != index);
change_ui_language_combobox_->SetSelectedItem(index);
« no previous file with comments | « chrome/browser/views/options/language_combobox_model.cc ('k') | chrome/test/automated_ui_tests/automated_ui_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698