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

Unified Diff: ui/views/ime/input_method_base.cc

Issue 23749007: Views: Fix keyboard input in linux_aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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: ui/views/ime/input_method_base.cc
diff --git a/ui/views/ime/input_method_base.cc b/ui/views/ime/input_method_base.cc
index aa9e4d77c36b1629bc991041590a2eaf95042f38..4c4298b7694176ad110b38ad56143bd103e59baa 100644
--- a/ui/views/ime/input_method_base.cc
+++ b/ui/views/ime/input_method_base.cc
@@ -29,10 +29,10 @@ void InputMethodBase::Init(Widget* widget) {
DCHECK(!widget_) << "The input method is already initialized.";
widget_ = widget;
- if (IsWidgetActive()) {
- // Alert the InputMethod of the Widget's currently focused view.
- OnFocus();
- }
+ // Alert the InputMethod of the Widget's currently focused view.
+ View* focused = widget->GetFocusManager()->GetFocusedView();
+ if (focused)
+ OnWillChangeFocus(NULL, focused);
widget->GetFocusManager()->AddFocusChangeListener(this);
}
@@ -60,12 +60,8 @@ void InputMethodBase::OnWillChangeFocus(View* focused_before, View* focused) {}
void InputMethodBase::OnDidChangeFocus(View* focused_before, View* focused) {}
-bool InputMethodBase::IsWidgetActive() const {
- return widget_ ? widget_->IsActive() : false;
-}
-
bool InputMethodBase::IsViewFocused(View* view) const {
- return IsWidgetActive() && view && GetFocusedView() == view;
+ return widget_ && widget_->IsActive() && view && GetFocusedView() == view;
}
bool InputMethodBase::IsTextInputTypeNone() const {

Powered by Google App Engine
This is Rietveld 408576698