summaryrefslogtreecommitdiffstats
path: root/views/widget/widget.cc
diff options
context:
space:
mode:
authoroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-24 21:39:02 +0000
committeroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-24 21:39:02 +0000
commitf0f1db697fe2ff3501611c6a024eaa8d619767ac (patch)
treea5581a395c888e7272e03c165ef3dfdc1c7b14b2 /views/widget/widget.cc
parent6acbd8dd984f3d4427f46d138464a21760676c7b (diff)
downloadchromium_src-f0f1db697fe2ff3501611c6a024eaa8d619767ac.zip
chromium_src-f0f1db697fe2ff3501611c6a024eaa8d619767ac.tar.gz
chromium_src-f0f1db697fe2ff3501611c6a024eaa8d619767ac.tar.bz2
* Fix wrong condition check in OnFocusOut.
* Create inputmethod only when it's requested via Widget::GetInputMethod. This is what original code did. BUG=none TEST=added WidgetTest::ChangeActivation Review URL: http://codereview.chromium.org/7729007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98118 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget/widget.cc')
-rw-r--r--views/widget/widget.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/views/widget/widget.cc b/views/widget/widget.cc
index 07a6687..45423c6 100644
--- a/views/widget/widget.cc
+++ b/views/widget/widget.cc
@@ -596,8 +596,14 @@ FocusManager* Widget::GetFocusManager() {
}
InputMethod* Widget::GetInputMethod() {
- Widget* toplevel_widget = GetTopLevelWidget();
- return toplevel_widget ? toplevel_widget->GetInputMethodDirect() : NULL;
+ if (is_top_level()) {
+ if (!input_method_.get())
+ ReplaceInputMethod(native_widget_->CreateInputMethod());
+ return input_method_.get();
+ } else {
+ Widget* toplevel = GetTopLevelWidget();
+ return toplevel ? toplevel->GetInputMethod() : NULL;
+ }
}
void Widget::RunShellDrag(View* view, const ui::OSExchangeData& data,
@@ -976,8 +982,6 @@ bool Widget::ExecuteCommand(int command_id) {
}
InputMethod* Widget::GetInputMethodDirect() {
- if (!input_method_.get() && is_top_level())
- ReplaceInputMethod(native_widget_->CreateInputMethod());
return input_method_.get();
}