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

Unified Diff: chrome/browser/chromeos/input_method/input_method_manager_impl.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
« no previous file with comments | « no previous file | chrome/browser/chromeos/input_method/input_method_util.h » ('j') | 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 91f399329a424d4d64291328ea572ee443ee883c..5286eab4ecab57d845c06cbeac09a3b0de550ed8 100644
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc
@@ -386,6 +386,8 @@ bool InputMethodManagerImpl::ChangeInputMethodInternal(
} else {
descriptor =
util_.GetInputMethodDescriptorFromId(input_method_id_to_switch);
+ if (!descriptor)
+ LOG(ERROR) << "Unknown input method id: " << input_method_id_to_switch;
}
DCHECK(descriptor);
@@ -411,8 +413,21 @@ void InputMethodManagerImpl::OnComponentExtensionInitialized(
scoped_ptr<ComponentExtensionIMEManagerDelegate> delegate) {
DCHECK(thread_checker_.CalledOnValidThread());
component_extension_ime_manager_->Initialize(delegate.Pass());
- util_.SetComponentExtensions(
- component_extension_ime_manager_->GetAllIMEAsInputMethodDescriptor());
+ InputMethodDescriptors imes =
+ component_extension_ime_manager_->GetAllIMEAsInputMethodDescriptor();
+ // In case of XKB extension is not available (e.g. linux_chromeos), don't
+ // reset the input methods in InputMethodUtil, Instead append input methods.
+ bool xkb_found = false;
+ for (size_t i = 0; i < imes.size(); ++i) {
+ if (StartsWithASCII(imes[i].id(), "xkb:", true)) {
+ xkb_found = true;
+ break;
+ }
+ }
+ if (xkb_found)
+ util_.ResetInputMethods(imes);
+ else
+ util_.AppendInputMethods(imes);
LoadNecessaryComponentExtensions();
« no previous file with comments | « no previous file | chrome/browser/chromeos/input_method/input_method_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698