Index: views/ime/input_method_base.cc |
diff --git a/views/ime/input_method_base.cc b/views/ime/input_method_base.cc |
index a062f6bd2d4840f397df8f0e2549148981809f67..aa8622e4e93b3669b0a83dc5c5461e0de148b0cf 100644 |
--- a/views/ime/input_method_base.cc |
+++ b/views/ime/input_method_base.cc |
@@ -39,6 +39,11 @@ void InputMethodBase::Init(Widget* widget) { |
} |
widget_ = widget; |
+ View* focused = widget->GetFocusManager()->GetFocusedView(); |
+ if (focused) { |
+ OnFocus(); |
+ FocusWillChange(NULL, focused); |
+ } |
sadrul
2011/06/22 01:47:21
I think this seeped through from 7222007?
|
widget->GetFocusManager()->AddFocusChangeListener(this); |
} |
@@ -50,6 +55,11 @@ void InputMethodBase::OnBlur() { |
widget_focused_ = false; |
} |
+void InputMethodBase::OnTextInputTypeChanged(View* view) { |
+ if (view == focused_view()) |
sadrul
2011/06/22 01:47:21
Is there a difference between checking 'view == fo
|
+ TextInputTypeChanged(focused_view()); |
+} |
+ |
TextInputClient* InputMethodBase::GetTextInputClient() const { |
return (widget_focused_ && focused_view_) ? |
focused_view_->GetTextInputClient() : NULL; |
@@ -65,6 +75,7 @@ void InputMethodBase::FocusWillChange(View* focused_before, View* focused) { |
FocusedViewWillChange(); |
focused_view_ = focused; |
FocusedViewDidChange(); |
+ TextInputTypeChanged(focused_view()); |
James Su
2011/06/22 03:05:15
Changing focus may not necessarily cause text inpu
Peng
2011/06/22 04:17:39
Probably the name is not good. It not only notify
James Su
2011/06/22 07:33:28
IMHO, the current text input type is the only stat
|
} |
bool InputMethodBase::IsViewFocused(View* view) const { |