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 a7778df8b8e842bf1f413a08d6c1908f895ed6eb..f1102d9f6c50f93b2fc255c098330842d0a19874 100644 |
--- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc |
+++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc |
@@ -284,17 +284,6 @@ bool InputMethodManagerImpl::ChangeInputMethodInternal( |
if (state_ == STATE_TERMINATING) |
return false; |
- if (!component_extension_ime_manager_->IsInitialized() || |
- (!InputMethodUtil::IsKeyboardLayout(input_method_id) && |
- !IsIBusConnectionAlive())) { |
- // We can't change input method before the initialization of component |
- // extension ime manager or before connection to ibus-daemon is not |
- // established. ChangeInputMethod will be called with |
- // |pending_input_method_| when the both initialization is done. |
- pending_input_method_ = input_method_id; |
- return false; |
- } |
- |
std::string input_method_id_to_switch = input_method_id; |
// Sanity check. |
@@ -309,6 +298,17 @@ bool InputMethodManagerImpl::ChangeInputMethodInternal( |
} |
} |
+ if (!component_extension_ime_manager_->IsInitialized() || |
+ (!InputMethodUtil::IsKeyboardLayout(input_method_id_to_switch) && |
+ !IsIBusConnectionAlive())) { |
+ // We can't change input method before the initialization of component |
+ // extension ime manager or before connection to ibus-daemon is not |
+ // established. ChangeInputMethod will be called with |
+ // |pending_input_method_| when the both initialization is done. |
+ pending_input_method_ = input_method_id_to_switch; |
+ return false; |
+ } |
+ |
IBusInputContextClient* input_context = |
chromeos::DBusThreadManager::Get()->GetIBusInputContextClient(); |
const std::string current_input_method_id = current_input_method_.id(); |