Commit d95cbbf8 authored by Yukawa@chromium.org's avatar Yukawa@chromium.org

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
parent 18dade7f
...@@ -955,7 +955,18 @@ void NativeTextfieldViews::InsertChar(char16 ch, int flags) { ...@@ -955,7 +955,18 @@ void NativeTextfieldViews::InsertChar(char16 ch, int flags) {
} }
gfx::NativeWindow NativeTextfieldViews::GetAttachedWindow() const { 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 { ui::TextInputType NativeTextfieldViews::GetTextInputType() const {
......
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