Chromium Code Reviews| 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 8d3fcc6432298ac6891096bb75786889698fc9c8..d0e0efabf450690e91582bbdf41742474778e202 100644 |
| --- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc |
| +++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc |
| @@ -112,7 +112,12 @@ void InputMethodManagerImpl::SetState(State new_state) { |
| scoped_ptr<InputMethodDescriptors> |
| InputMethodManagerImpl::GetSupportedInputMethods() const { |
| - return whitelist_.GetSupportedInputMethods(); |
| + if (!extension_ime_util::UseWrappedExtensionKeyboardLayouts()) { |
| + return whitelist_.GetSupportedInputMethods(); |
| + } |
| + // Returns empty list because all the supported imes have been migrated to |
| + // component extension imes. |
| + return scoped_ptr<InputMethodDescriptors>(new InputMethodDescriptors).Pass(); |
| } |
| scoped_ptr<InputMethodDescriptors> |
| @@ -249,14 +254,10 @@ void InputMethodManagerImpl::ReconfigureIMFramework() { |
| if (component_extension_ime_manager_->IsInitialized()) |
|
Yuki
2014/03/07 07:47:04
We don't need this conditional. LoadNecessaryComp
Shu Chen
2014/03/07 08:24:09
Done.
|
| LoadNecessaryComponentExtensions(); |
| - const bool need_engine = |
| - !ContainsOnlyKeyboardLayout(active_input_method_ids_); |
| - |
| // Initialize candidate window controller and widgets such as |
| // candidate window, infolist and mode indicator. Note, mode |
| // indicator is used by only keyboard layout input methods. |
| - if (need_engine || active_input_method_ids_.size() > 1) |
| - MaybeInitializeCandidateWindowController(); |
| + MaybeInitializeCandidateWindowController(); |
| } |
| bool InputMethodManagerImpl::EnableInputMethod( |
| @@ -352,7 +353,9 @@ bool InputMethodManagerImpl::ChangeInputMethodInternal( |
| engine->Disable(); |
| // Configure the next engine handler. |
| - if (InputMethodUtil::IsKeyboardLayout(input_method_id_to_switch)) { |
| + if (InputMethodUtil::IsKeyboardLayout(input_method_id_to_switch) && |
| + !extension_ime_util::IsKeyboardLayoutExtension( |
| + input_method_id_to_switch)) { |
| IMEBridge::Get()->SetCurrentEngineHandler(NULL); |
| } else { |
| IMEEngineHandlerInterface* next_engine = |
| @@ -413,6 +416,7 @@ void InputMethodManagerImpl::OnComponentExtensionInitialized( |
| component_extension_ime_manager_->GetAllIMEAsInputMethodDescriptor()); |
| LoadNecessaryComponentExtensions(); |
| + component_extension_ime_manager_->NotifyInitialized(); |
|
Yuki
2014/03/07 07:47:04
In general, This sort of methods (NotifyFoobar())
Shu Chen
2014/03/07 08:24:09
This NotifyInitialized() should be called only onc
Yuki
2014/03/07 09:02:28
Then, could you add a flag inside ComponentExtensi
|
| if (!pending_input_method_.empty()) |
| ChangeInputMethodInternal(pending_input_method_, false); |
| @@ -835,15 +839,6 @@ bool InputMethodManagerImpl::InputMethodIsActivated( |
| return Contains(active_input_method_ids_, input_method_id); |
| } |
| -bool InputMethodManagerImpl::ContainsOnlyKeyboardLayout( |
| - const std::vector<std::string>& value) { |
| - for (size_t i = 0; i < value.size(); ++i) { |
| - if (!InputMethodUtil::IsKeyboardLayout(value[i])) |
| - return false; |
| - } |
| - return true; |
| -} |
| - |
| void InputMethodManagerImpl::MaybeInitializeCandidateWindowController() { |
| if (candidate_window_controller_.get()) |
| return; |