Chromium Code Reviews| Index: views/ime/input_method_base.cc |
| diff --git a/views/ime/input_method_base.cc b/views/ime/input_method_base.cc |
| index 5716f46a45ed7ad173ad268da6c12ee52ede3bda..e152b023d4b4d7ab43f4e6b2acfd46df810d7ca7 100644 |
| --- a/views/ime/input_method_base.cc |
| +++ b/views/ime/input_method_base.cc |
| @@ -3,6 +3,7 @@ |
| // found in the LICENSE file. |
| #include "views/ime/input_method_base.h" |
| +#include "views/ime/input_method_manager.h" |
| #include "views/view.h" |
| #include "views/widget/widget.h" |
| @@ -47,10 +48,21 @@ void InputMethodBase::Init(Widget* widget) { |
| void InputMethodBase::OnFocus() { |
| widget_focused_ = true; |
| + InputMethodManager *manager = InputMethodManager::GetInstance(); |
| + manager->OnTextInputTypeChanged(GetTextInputType(), widget_); |
|
James Su
2011/07/07 02:03:03
nit:
1. how about to combine these two lines? The
Peng
2011/07/07 17:56:54
Done.
James Su
2011/07/08 02:15:04
If it's necessary then it's better to state it in
|
| } |
| void InputMethodBase::OnBlur() { |
| widget_focused_ = false; |
| + InputMethodManager *manager = InputMethodManager::GetInstance(); |
| + manager->OnTextInputTypeChanged(GetTextInputType(), widget_); |
|
James Su
2011/07/07 02:03:03
ditto
Peng
2011/07/07 17:56:54
Done.
|
| +} |
| + |
| +void InputMethodBase::OnTextInputTypeChanged(View* view) { |
| + if (IsViewFocused(view)) { |
| + InputMethodManager *manager = InputMethodManager::GetInstance(); |
| + manager->OnTextInputTypeChanged(GetTextInputType(), widget_); |
|
James Su
2011/07/07 02:03:03
ditto
Peng
2011/07/07 17:56:54
Done.
|
| + } |
| } |
| TextInputClient* InputMethodBase::GetTextInputClient() const { |
| @@ -108,6 +120,10 @@ void InputMethodBase::FocusedViewWillChange() { |
| } |
| void InputMethodBase::FocusedViewDidChange() { |
| + if (widget_focused_) { |
| + InputMethodManager *manager = InputMethodManager::GetInstance(); |
| + manager->OnTextInputTypeChanged(GetTextInputType(), widget_); |
| + } |
|
James Su
2011/07/07 02:03:03
move these code into FocusWillChange(). It may not
Peng
2011/07/07 17:56:54
Done.
|
| } |
| } // namespace views |