summaryrefslogtreecommitdiffstats
path: root/views/widget
diff options
context:
space:
mode:
authoroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-25 21:21:34 +0000
committeroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-25 21:21:34 +0000
commitf1cb4ec9e2b58a0afda88c00bbbed7c2075c9725 (patch)
treecc6fc23cf405a946a6d412d5ca5d5c276b94bb28 /views/widget
parentc82b06f5608a6907f96712dddcc3f51c359ac57e (diff)
downloadchromium_src-f1cb4ec9e2b58a0afda88c00bbbed7c2075c9725.zip
chromium_src-f1cb4ec9e2b58a0afda88c00bbbed7c2075c9725.tar.gz
chromium_src-f1cb4ec9e2b58a0afda88c00bbbed7c2075c9725.tar.bz2
Possible fix for the issue that keyboard doesn't show up.
Always create InputMethod object instead of being lazy. BUG=none TEST=none Review URL: http://codereview.chromium.org/7744029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98303 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r--views/widget/native_widget_gtk.cc8
-rw-r--r--views/widget/native_widget_views.cc8
2 files changed, 6 insertions, 10 deletions
diff --git a/views/widget/native_widget_gtk.cc b/views/widget/native_widget_gtk.cc
index e303aef8..75778c9 100644
--- a/views/widget/native_widget_gtk.cc
+++ b/views/widget/native_widget_gtk.cc
@@ -974,8 +974,6 @@ InputMethod* NativeWidgetGtk::CreateInputMethod() {
InputMethod* input_method = new InputMethodGtk(this);
#endif
input_method->Init(GetWidget());
- if (has_focus_)
- input_method->OnFocus();
return input_method;
}
// GTK's textfield handles IME.
@@ -1643,7 +1641,7 @@ gboolean NativeWidgetGtk::OnFocusIn(GtkWidget* widget, GdkEventFocus* event) {
return false;
// Only top-level Widget should have an InputMethod instance.
- InputMethod* input_method = GetWidget()->GetInputMethodDirect();
+ InputMethod* input_method = GetWidget()->GetInputMethod();
if (input_method)
input_method->OnFocus();
@@ -1667,7 +1665,7 @@ gboolean NativeWidgetGtk::OnFocusOut(GtkWidget* widget, GdkEventFocus* event) {
return false;
// Only top-level Widget should have an InputMethod instance.
- InputMethod* input_method = GetWidget()->GetInputMethodDirect();
+ InputMethod* input_method = GetWidget()->GetInputMethod();
if (input_method)
input_method->OnBlur();
return false;
@@ -1675,7 +1673,7 @@ gboolean NativeWidgetGtk::OnFocusOut(GtkWidget* widget, GdkEventFocus* event) {
gboolean NativeWidgetGtk::OnEventKey(GtkWidget* widget, GdkEventKey* event) {
KeyEvent key(reinterpret_cast<NativeEvent>(event));
- InputMethod* input_method = GetWidget()->GetInputMethodDirect();
+ InputMethod* input_method = GetWidget()->GetInputMethod();
if (input_method)
input_method->DispatchKeyEvent(key);
else
diff --git a/views/widget/native_widget_views.cc b/views/widget/native_widget_views.cc
index c029b2f..eb7047f 100644
--- a/views/widget/native_widget_views.cc
+++ b/views/widget/native_widget_views.cc
@@ -67,15 +67,13 @@ void NativeWidgetViews::OnActivate(bool active) {
// This will be fixed when we have WM API.
Widget* widget = GetWidget();
if (widget->is_top_level()) {
- InputMethod* input_method = widget->GetInputMethodDirect();
+ InputMethod* input_method = widget->GetInputMethod();
if (active) {
- if (input_method)
- input_method->OnFocus();
+ input_method->OnFocus();
// See description of got_initial_focus_in_ for details on this.
widget->GetFocusManager()->RestoreFocusedView();
} else {
- if (input_method)
- input_method->OnBlur();
+ input_method->OnBlur();
widget->GetFocusManager()->StoreFocusedView();
}
}