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

Unified Diff: chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc

Issue 10907196: Add the ability to filter out extension IMEs from the language settings page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mock input manager Created 8 years, 3 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/ui/webui/options/chromeos/cros_language_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc
index 5c44ddbb946b32d65b90aef7794797731c6ff2f3..ba4245cb80bb7b0458d8ea6637eb38dfb55b57a5 100644
--- a/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc
@@ -67,6 +67,12 @@ void CrosLanguageOptionsHandler::GetLocalizedValues(
localized_strings->SetString("restart_button",
l10n_util::GetStringUTF16(
IDS_OPTIONS_SETTINGS_LANGUAGES_SIGN_OUT_BUTTON));
+ localized_strings->SetString("extension_ime_label",
+ l10n_util::GetStringUTF16(
+ IDS_OPTIONS_SETTINGS_LANGUAGES_INPUT_METHOD_EXTENSION_IME));
+ localized_strings->SetString("extension_ime_description",
+ l10n_util::GetStringUTF16(
+ IDS_OPTIONS_SETTINGS_LANGUAGES_INPUT_METHOD_EXTENSION_DESCRIPTION));
input_method::InputMethodManager* manager =
input_method::InputMethodManager::GetInstance();
@@ -75,6 +81,7 @@ void CrosLanguageOptionsHandler::GetLocalizedValues(
manager->GetSupportedInputMethods());
localized_strings->Set("languageList", GetLanguageList(*descriptors));
localized_strings->Set("inputMethodList", GetInputMethodList(*descriptors));
+ localized_strings->Set("extensionImeList", GetExtensionImeList());
}
void CrosLanguageOptionsHandler::RegisterMessages() {
@@ -193,7 +200,7 @@ ListValue* CrosLanguageOptionsHandler::GetLanguageList(
const LanguagePair& pair = language_map[display_names[i]];
DictionaryValue* dictionary = new DictionaryValue();
- dictionary->SetString("code", pair.first);
+ dictionary->SetString("code", pair.first);
dictionary->SetString("displayName", display_names[i]);
dictionary->SetString("textDirection", directionality);
dictionary->SetString("nativeDisplayName", pair.second);
@@ -203,6 +210,26 @@ ListValue* CrosLanguageOptionsHandler::GetLanguageList(
return language_list;
}
+base::ListValue* CrosLanguageOptionsHandler::GetExtensionImeList() {
+ input_method::InputMethodManager* manager =
+ input_method::InputMethodManager::GetInstance();
+
+ input_method::InputMethodDescriptors descriptors;
+ manager->GetInputMethodExtensions(&descriptors);
+
+ ListValue* extension_ime_ids_list = new ListValue();
+
+ for (size_t i = 0; i < descriptors.size(); ++i) {
+ const input_method::InputMethodDescriptor& descriptor = descriptors[i];
+ DictionaryValue* dictionary = new DictionaryValue();
+ dictionary->SetString("id", descriptor.id());
+ dictionary->SetString("displayName", descriptor.name());
+ extension_ime_ids_list->Append(dictionary);
+ }
+
+ return extension_ime_ids_list;
+}
+
string16 CrosLanguageOptionsHandler::GetProductName() {
return l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_OS_NAME);
}
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.h ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698