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

Unified Diff: chrome/browser/chromeos/input_method/input_method_util.cc

Issue 312443002: Updates the whitelisted XKB input method IDs to sync up with the component XKB extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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/chromeos/input_method/input_method_util.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_util.cc b/chrome/browser/chromeos/input_method/input_method_util.cc
index 4361b1154cfad28ac7af7beeb9278e4a1df2739d..d644660e2a111278bbe9bc8c91950482dd82bb51 100644
--- a/chrome/browser/chromeos/input_method/input_method_util.cc
+++ b/chrome/browser/chromeos/input_method/input_method_util.cc
@@ -800,8 +800,7 @@ bool InputMethodUtil::IsLoginKeyboard(const std::string& input_method_id)
return ime ? ime->is_login_keyboard() : false;
}
-void InputMethodUtil::SetComponentExtensions(
- const InputMethodDescriptors& imes) {
+void InputMethodUtil::AppendInputMethods(const InputMethodDescriptors& imes) {
for (size_t i = 0; i < imes.size(); ++i) {
const InputMethodDescriptor& input_method = imes[i];
DCHECK(!input_method.language_codes().empty());
@@ -826,6 +825,15 @@ void InputMethodUtil::SetComponentExtensions(
}
}
+void InputMethodUtil::ResetInputMethods(const InputMethodDescriptors& imes) {
+ // Clear the existing maps.
+ language_code_to_ids_.clear();
+ id_to_language_code_.clear();
+ id_to_descriptor_.clear();
+
+ AppendInputMethods(imes);
+}
+
void InputMethodUtil::InitXkbInputMethodsForTesting() {
cached_hardware_layouts_.clear();
if (!extension_ime_util::UseWrappedExtensionKeyboardLayouts())
@@ -845,7 +853,7 @@ void InputMethodUtil::InitXkbInputMethodsForTesting() {
ime.options_page_url(),
ime.input_view_url()));
}
- SetComponentExtensions(whitelist_imes);
+ ResetInputMethods(whitelist_imes);
}
InputMethodDescriptor InputMethodUtil::GetFallbackInputMethodDescriptor() {

Powered by Google App Engine
This is Rietveld 408576698