Commit 8f2ffcec authored by oshima@google.com's avatar oshima@google.com

minor fixes to get virtual keyboard work on views desktop without ibus

 * Call OnTextInputTypeChanged from Mock class (which is used when ibus is not present)
 * Don't create InputMethod in desktop window.
 * Fix comment on RWHVV to be more accurate.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/7761008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98676 0039d316-1c4b-4281-b951-d872f2087c98
parent 5dec2ba3
...@@ -174,13 +174,15 @@ class RenderWidgetHostViewViews : public RenderWidgetHostView, ...@@ -174,13 +174,15 @@ class RenderWidgetHostViewViews : public RenderWidgetHostView,
#endif #endif
protected: protected:
// Overridden from RenderWidgetHostView / views::View. // Overridden views::View.
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
virtual void Focus() OVERRIDE;
virtual void Blur() OVERRIDE;
virtual void OnFocus() OVERRIDE; virtual void OnFocus() OVERRIDE;
virtual void OnBlur() OVERRIDE; virtual void OnBlur() OVERRIDE;
// Overridden from RenderWidgetHostView
virtual void Focus() OVERRIDE;
virtual void Blur() OVERRIDE;
private: private:
friend class RenderWidgetHostViewViewsWidget; friend class RenderWidgetHostViewViewsWidget;
......
...@@ -80,6 +80,7 @@ void MockInputMethod::DispatchKeyEvent(const KeyEvent& key) { ...@@ -80,6 +80,7 @@ void MockInputMethod::DispatchKeyEvent(const KeyEvent& key) {
void MockInputMethod::OnTextInputTypeChanged(View* view) { void MockInputMethod::OnTextInputTypeChanged(View* view) {
if (IsViewFocused(view)) if (IsViewFocused(view))
text_input_type_changed_ = true; text_input_type_changed_ = true;
InputMethodBase::OnTextInputTypeChanged(view);
} }
void MockInputMethod::OnCaretBoundsChanged(View* view) { void MockInputMethod::OnCaretBoundsChanged(View* view) {
......
...@@ -961,10 +961,11 @@ bool NativeWidgetGtk::HasMouseCapture() const { ...@@ -961,10 +961,11 @@ bool NativeWidgetGtk::HasMouseCapture() const {
} }
InputMethod* NativeWidgetGtk::CreateInputMethod() { InputMethod* NativeWidgetGtk::CreateInputMethod() {
// Create input method when pure views is enabled. // Create input method when pure views is enabled but not on views desktop.
// TODO(suzhe): Always enable input method when we start to use // TODO(suzhe): Always enable input method when we start to use
// RenderWidgetHostViewViews in normal ChromeOS. // RenderWidgetHostViewViews in normal ChromeOS.
if (views::Widget::IsPureViews()) { if (views::Widget::IsPureViews() &&
!ViewsDelegate::views_delegate->GetDefaultParentView()) {
#if defined(HAVE_IBUS) #if defined(HAVE_IBUS)
InputMethod* input_method = InputMethod* input_method =
InputMethodIBus::IsInputMethodIBusEnabled() ? InputMethodIBus::IsInputMethodIBusEnabled() ?
...@@ -976,7 +977,7 @@ InputMethod* NativeWidgetGtk::CreateInputMethod() { ...@@ -976,7 +977,7 @@ InputMethod* NativeWidgetGtk::CreateInputMethod() {
input_method->Init(GetWidget()); input_method->Init(GetWidget());
return input_method; return input_method;
} }
// GTK's textfield handles IME. // GTK's textfield or InputMethod in NativeWidgetViews will handle IME.
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment