diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-16 17:58:17 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-16 17:58:17 +0000 |
commit | 329fbb3db9e40f26bc4446894062b6c636667d65 (patch) | |
tree | fa46fe9dae384368f9f70f8bbfff813e084b3c25 /ui/views/ime | |
parent | 45e13f69d039d4de73bbef0450d992b7e047cb08 (diff) | |
download | chromium_src-329fbb3db9e40f26bc4446894062b6c636667d65.zip chromium_src-329fbb3db9e40f26bc4446894062b6c636667d65.tar.gz chromium_src-329fbb3db9e40f26bc4446894062b6c636667d65.tar.bz2 |
Views: Fix keyboard input in linux_aura.
Revert "Do nothing unless the attached widget is active in
InputMethodBridge::OnFocus". This reverts commit r222304.
BUG=287620, 291256
R=nona@chromium.org, yukawa@chromium.org
Review URL: https://codereview.chromium.org/23749007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223358 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/ime')
-rw-r--r-- | ui/views/ime/input_method_base.cc | 14 | ||||
-rw-r--r-- | ui/views/ime/input_method_base.h | 3 | ||||
-rw-r--r-- | ui/views/ime/input_method_bridge.cc | 9 |
3 files changed, 8 insertions, 18 deletions
diff --git a/ui/views/ime/input_method_base.cc b/ui/views/ime/input_method_base.cc index aa9e4d7..4c4298b 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 { diff --git a/ui/views/ime/input_method_base.h b/ui/views/ime/input_method_base.h index 37e8a66..da454fb 100644 --- a/ui/views/ime/input_method_base.h +++ b/ui/views/ime/input_method_base.h @@ -45,9 +45,6 @@ class VIEWS_EXPORT InputMethodBase : public InputMethod, Widget* widget() const { return widget_; } View* GetFocusedView() const; - // Returns true only if a valid widget is attached and active. - bool IsWidgetActive() const; - // Returns true only if the View is focused and its Widget is active. bool IsViewFocused(View* view) const; diff --git a/ui/views/ime/input_method_bridge.cc b/ui/views/ime/input_method_bridge.cc index 760bd59..8165a60 100644 --- a/ui/views/ime/input_method_bridge.cc +++ b/ui/views/ime/input_method_bridge.cc @@ -33,8 +33,7 @@ InputMethodBridge::~InputMethodBridge() { void InputMethodBridge::OnFocus() { // Direct the shared IME to send TextInputClient messages to |this| object. - if (IsWidgetActive() && - (shared_input_method_ || !host_->GetTextInputClient())) + if (shared_input_method_ || !host_->GetTextInputClient()) host_->SetFocusedTextInputClient(this); // TODO(yusukes): We don't need to call OnTextInputTypeChanged() once we move @@ -55,8 +54,6 @@ void InputMethodBridge::OnBlur() { bool InputMethodBridge::OnUntranslatedIMEMessage(const base::NativeEvent& event, NativeEventResult* result) { - if (!IsWidgetActive()) - return false; return host_->OnUntranslatedIMEMessage(event, result); } @@ -85,8 +82,7 @@ void InputMethodBridge::CancelComposition(View* view) { } void InputMethodBridge::OnInputLocaleChanged() { - if (IsWidgetActive()) - host_->OnInputLocaleChanged(); + return host_->OnInputLocaleChanged(); } std::string InputMethodBridge::GetInputLocale() { @@ -256,4 +252,5 @@ ui::InputMethod* InputMethodBridge::GetHostInputMethod() const { return host_; } + } // namespace views |