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

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

Issue 14027007: Add sanity check for deprecated component extension IME. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments Created 7 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/input_method/input_method_manager_impl.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
index 0aab684ef53c7f1d90e98c8f8b29ab7a740011fc..90cabc1eead3dc8b8f9354454390fea030b6db9b 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
@@ -348,11 +348,23 @@ void InputMethodManagerImpl::OnComponentExtensionInitialized(
void InputMethodManagerImpl::LoadNecessaryComponentExtensions() {
if (!component_extension_ime_manager_->IsInitialized())
return;
- for (size_t i = 0; i < active_input_method_ids_.size(); ++i) {
- if (component_extension_ime_manager_->IsWhitelisted(
- active_input_method_ids_[i])) {
+ // Load component extensions but also update |active_input_method_ids_| as
+ // some component extension IMEs may have been removed from the Chrome OS
+ // image. If specified component extension IME no longer exists, falling back
+ // to an existing IME.
+ std::vector<std::string> unfiltered_input_method_ids =
+ active_input_method_ids_;
+ active_input_method_ids_.clear();
+ for (size_t i = 0; i < unfiltered_input_method_ids.size(); ++i) {
+ if (!component_extension_ime_manager_->IsComponentExtensionIMEId(
+ unfiltered_input_method_ids[i])) {
+ // Legacy IMEs or xkb layouts are alwayes active.
+ active_input_method_ids_.push_back(unfiltered_input_method_ids[i]);
+ } else if (component_extension_ime_manager_->IsWhitelisted(
+ unfiltered_input_method_ids[i])) {
component_extension_ime_manager_->LoadComponentExtensionIME(
- active_input_method_ids_[i]);
+ unfiltered_input_method_ids[i]);
+ active_input_method_ids_.push_back(unfiltered_input_method_ids[i]);
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698