summaryrefslogtreecommitdiffstats
path: root/views/widget
diff options
context:
space:
mode:
authoroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-25 04:34:11 +0000
committeroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-25 04:34:11 +0000
commiteaeaf86449c9cee06d432759e7ebe128f89317b8 (patch)
treea0c3e4cb68b4058418b4609e24d4cc94ef63e6cf /views/widget
parent336c68f1db6d5e4bbd45d6c18a64222e34133979 (diff)
downloadchromium_src-eaeaf86449c9cee06d432759e7ebe128f89317b8.zip
chromium_src-eaeaf86449c9cee06d432759e7ebe128f89317b8.tar.gz
chromium_src-eaeaf86449c9cee06d432759e7ebe128f89317b8.tar.bz2
Focus fix. InputMethod needs to be initialized before calling OnFocus
TBR=penghaung@chromium.org BUG=none TEST=none Review URL: http://codereview.chromium.org/7746005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98184 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r--views/widget/native_widget_gtk.cc1
-rw-r--r--views/widget/native_widget_views.cc6
-rw-r--r--views/widget/native_widget_win.cc7
-rw-r--r--views/widget/widget.cc2
4 files changed, 12 insertions, 4 deletions
diff --git a/views/widget/native_widget_gtk.cc b/views/widget/native_widget_gtk.cc
index b2a4342..e303aef8 100644
--- a/views/widget/native_widget_gtk.cc
+++ b/views/widget/native_widget_gtk.cc
@@ -973,6 +973,7 @@ InputMethod* NativeWidgetGtk::CreateInputMethod() {
#else
InputMethod* input_method = new InputMethodGtk(this);
#endif
+ input_method->Init(GetWidget());
if (has_focus_)
input_method->OnFocus();
return input_method;
diff --git a/views/widget/native_widget_views.cc b/views/widget/native_widget_views.cc
index 5fc8721..6e0139b 100644
--- a/views/widget/native_widget_views.cc
+++ b/views/widget/native_widget_views.cc
@@ -236,10 +236,12 @@ bool NativeWidgetViews::HasMouseCapture() const {
InputMethod* NativeWidgetViews::CreateInputMethod() {
#if defined(HAVE_IBUS)
- return new InputMethodIBus(this);
+ InputMethod* input_method = new InputMethodIBus(this);
#else
- return new MockInputMethod(this);
+ InputMethod* input_method = new MockInputMethod(this);
#endif
+ input_method->Init(GetWidget());
+ return input_method;
}
void NativeWidgetViews::CenterWindow(const gfx::Size& size) {
diff --git a/views/widget/native_widget_win.cc b/views/widget/native_widget_win.cc
index 16fca92..8c20b03 100644
--- a/views/widget/native_widget_win.cc
+++ b/views/widget/native_widget_win.cc
@@ -622,7 +622,12 @@ bool NativeWidgetWin::HasMouseCapture() const {
}
InputMethod* NativeWidgetWin::CreateInputMethod() {
- return views::Widget::IsPureViews() ? new InputMethodWin(this) : NULL;
+ if (views::Widget::IsPureViews()) {
+ InputMethod* input_method = new InputMethodWin(this);
+ input_method->Init(GetWidget());
+ return input_method;
+ }
+ return NULL;
}
void NativeWidgetWin::CenterWindow(const gfx::Size& size) {
diff --git a/views/widget/widget.cc b/views/widget/widget.cc
index 12956ee..0e10047 100644
--- a/views/widget/widget.cc
+++ b/views/widget/widget.cc
@@ -601,7 +601,7 @@ FocusManager* Widget::GetFocusManager() {
InputMethod* Widget::GetInputMethod() {
if (is_top_level()) {
if (!input_method_.get())
- ReplaceInputMethod(native_widget_->CreateInputMethod());
+ input_method_.reset(native_widget_->CreateInputMethod());
return input_method_.get();
} else {
Widget* toplevel = GetTopLevelWidget();