summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYukawa@chromium.org <Yukawa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-22 13:37:49 +0000
committerYukawa@chromium.org <Yukawa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-22 13:37:49 +0000
commitd95cbbf84a22d12d599cf3573cc13141748fcc26 (patch)
treed93a3c61e229b870ab33297dde1bf468a935d31d
parent18dade7f2b5e698cf3e1633bc23a3ccfe110ece0 (diff)
downloadchromium_src-d95cbbf84a22d12d599cf3573cc13141748fcc26.zip
chromium_src-d95cbbf84a22d12d599cf3573cc13141748fcc26.tar.gz
chromium_src-d95cbbf84a22d12d599cf3573cc13141748fcc26.tar.bz2
Consider IME is associated with the top level widget rather than child widget.
An important thing is that [NativeWidget A] owns Win32 input focus even when [View X] is logically focused by FocusManager. As a result, an Win32 IME may want to interact with the native view of [NativeWidget A] rather than that of [NativeWidget B]. This is why we need to call GetTopLevelWidget() here. Previous implementation treated [NativeWidget B] as associated with the IME but it was wrong. This CL fixes the this confusion. BUG=246534 Review URL: https://chromiumcodereview.appspot.com/17101019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208018 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ui/views/controls/textfield/native_textfield_views.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/ui/views/controls/textfield/native_textfield_views.cc b/ui/views/controls/textfield/native_textfield_views.cc
index e3175f8..d8d0dba 100644
--- a/ui/views/controls/textfield/native_textfield_views.cc
+++ b/ui/views/controls/textfield/native_textfield_views.cc
@@ -955,7 +955,18 @@ void NativeTextfieldViews::InsertChar(char16 ch, int flags) {
}
gfx::NativeWindow NativeTextfieldViews::GetAttachedWindow() const {
- return GetWidget()->GetNativeWindow();
+ // Imagine the following hierarchy.
+ // [NativeWidget A] - FocusManager
+ // [View]
+ // [NativeWidget B]
+ // [View]
+ // [View X]
+ // An important thing is that [NativeWidget A] owns Win32 input focus even
+ // when [View X] is logically focused by FocusManager. As a result, an Win32
+ // IME may want to interact with the native view of [NativeWidget A] rather
+ // than that of [NativeWidget B]. This is why we need to call
+ // GetTopLevelWidget() here.
+ return GetWidget()->GetTopLevelWidget()->GetNativeView();
}
ui::TextInputType NativeTextfieldViews::GetTextInputType() const {