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

Unified Diff: chrome/browser/chromeos/dom_ui/language_options_handler.cc

Issue 3041025: Implement "Add" and "Remove" buttons in Language and Input page. (Closed)
Patch Set: link-button Created 10 years, 5 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
« no previous file with comments | « chrome/browser/chromeos/dom_ui/language_options_handler.h ('k') | chrome/browser/resources/options.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/dom_ui/language_options_handler.cc
diff --git a/chrome/browser/chromeos/dom_ui/language_options_handler.cc b/chrome/browser/chromeos/dom_ui/language_options_handler.cc
index a28eae1963f59b54a9286a2d5684e4651e551a02..7bbdbb8a644aea7b35a10f027a8e2297e05463dd 100644
--- a/chrome/browser/chromeos/dom_ui/language_options_handler.cc
+++ b/chrome/browser/chromeos/dom_ui/language_options_handler.cc
@@ -45,15 +45,8 @@ void LanguageOptionsHandler::GetLocalizedValues(
IDS_OPTIONS_SETTINGS_LANGUAGES_DISPLAY_IN_THIS_LANGUAGE,
l10n_util::GetString(IDS_PRODUCT_OS_NAME)));
- // Build mappings of locale code (language code) to display name
- // (ex. "en-US" => "English (United States)".
- const std::vector<std::string>& locales = l10n_util::GetAvailableLocales();
- for (size_t i = 0; i < locales.size(); ++i) {
- localized_strings->SetString(UTF8ToWide(locales[i]),
- chromeos::input_method::GetLanguageDisplayNameFromCode(locales[i]));
- }
-
localized_strings->Set(L"inputMethodList", GetInputMethodList());
+ localized_strings->Set(L"languageList", GetLanguageList());
}
ListValue* LanguageOptionsHandler::GetInputMethodList() {
@@ -80,3 +73,18 @@ ListValue* LanguageOptionsHandler::GetInputMethodList() {
return input_method_list;
}
+
+ListValue* LanguageOptionsHandler::GetLanguageList() {
+ ListValue* language_list = new ListValue();
+
+ const std::vector<std::string>& locales = l10n_util::GetAvailableLocales();
+ for (size_t i = 0; i < locales.size(); ++i) {
+ DictionaryValue* dictionary = new DictionaryValue();
+ dictionary->SetString(L"code", UTF8ToWide(locales[i]));
+ dictionary->SetString(L"displayName",
+ chromeos::input_method::GetLanguageDisplayNameFromCode(locales[i]));
+ language_list->Append(dictionary);
+ }
+
+ return language_list;
+}
« no previous file with comments | « chrome/browser/chromeos/dom_ui/language_options_handler.h ('k') | chrome/browser/resources/options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698