Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Unified Diff: views/ime/input_method_base.cc

Issue 7217008: Use input method to control visibility of virtual keyboard (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Update Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..c6e9b19aeb8de8831cc97017f83313feca20c667 100644
--- a/views/ime/input_method_base.cc
+++ b/views/ime/input_method_base.cc
@@ -39,6 +39,9 @@ void InputMethodBase::Init(Widget* widget) {
}
widget_ = widget;
+ View* focused = widget->GetFocusManager()->GetFocusedView();
+ if (focused)
+ FocusWillChange(NULL, focused);
widget->GetFocusManager()->AddFocusChangeListener(this);
}
@@ -50,7 +53,14 @@ void InputMethodBase::OnBlur() {
widget_focused_ = false;
}
+void InputMethodBase::OnTextInputTypeChanged(View* view) {
+ if (view == focused_view())
+ TextInputTypeChanged(focused_view());
+}
+
TextInputClient* InputMethodBase::GetTextInputClient() const {
+ return (focused_view_) ?
+ focused_view_->GetTextInputClient() : NULL;
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());
}
bool InputMethodBase::IsViewFocused(View* view) const {

Powered by Google App Engine
This is Rietveld 408576698