Chromium Code Reviews| Index: components/arc/ime/arc_ime_service.cc |
| diff --git a/components/arc/ime/arc_ime_service.cc b/components/arc/ime/arc_ime_service.cc |
| index 3e4e4da932d13f4cb61a9b6306c4a0731139f688..7f268a4894ff5346a8dae4e8cb799329ee34141b 100644 |
| --- a/components/arc/ime/arc_ime_service.cc |
| +++ b/components/arc/ime/arc_ime_service.cc |
| @@ -126,22 +126,11 @@ void ArcImeService::OnWindowFocused(aura::Window* gained_focus, |
| // Overridden from arc::ArcImeBridge::Delegate |
| void ArcImeService::OnTextInputTypeChanged(ui::TextInputType type) { |
| - if (ime_type_ == type) |
|
kinaba
2016/06/14 04:22:08
Although it's a matter of taste, can we keep this
takaoka
2016/06/14 05:55:51
Done.
|
| - return; |
| + ui::TextInputType previous_type = ime_type_; |
| ime_type_ = type; |
| - |
| ui::InputMethod* const input_method = GetInputMethod(); |
| - if (input_method) { |
| + if (input_method && ime_type_ != previous_type) { |
| input_method->OnTextInputTypeChanged(this); |
| - if (input_method->GetTextInputClient() == this && |
| - ime_type_ != ui::TEXT_INPUT_TYPE_NONE) { |
| - // TODO(kinaba): crbug.com/581282. This is tentative short-term solution. |
| - // |
| - // For fully correct implementation, rather than to piggyback the "show" |
| - // request with the input type change, we need dedicated IPCs to share the |
| - // virtual keyboard show/hide states between Chromium and ARC. |
| - input_method->ShowImeIfNeeded(); |
|
kinaba
2016/06/14 04:22:08
Removing this code at once causes a regression in
takaoka
2016/06/14 05:55:51
Done.
|
| - } |
| } |
| } |
| @@ -161,6 +150,13 @@ void ArcImeService::OnCancelComposition() { |
| input_method->CancelComposition(this); |
| } |
| +void ArcImeService::ShowImeIfNeeded() { |
| + ui::InputMethod* const input_method = GetInputMethod(); |
| + if (input_method && input_method->GetTextInputClient() == this) { |
| + input_method->ShowImeIfNeeded(); |
| + } |
| +} |
| + |
| //////////////////////////////////////////////////////////////////////////////// |
| // Oberridden from ui::TextInputClient: |