| Index: ui/base/ime/input_method_imm32.cc
|
| diff --git a/ui/base/ime/input_method_imm32.cc b/ui/base/ime/input_method_imm32.cc
|
| index 4f17ea9a19bcaf0512925686c5acd292f3ff8531..ca02fa3e37321c67a8d7ae7dc73432e8597f4979 100644
|
| --- a/ui/base/ime/input_method_imm32.cc
|
| +++ b/ui/base/ime/input_method_imm32.cc
|
| @@ -94,26 +94,23 @@ void InputMethodIMM32::OnTextInputTypeChanged(const TextInputClient* client) {
|
| }
|
|
|
| void InputMethodIMM32::OnCaretBoundsChanged(const TextInputClient* client) {
|
| - if (!enabled_ || !IsTextInputClientFocused(client) ||
|
| - !IsWindowFocused(client)) {
|
| - return;
|
| + if (enabled_ && IsTextInputClientFocused(client) && IsWindowFocused(client)) {
|
| + // The current text input type should not be NONE if |client| is focused.
|
| + DCHECK(!IsTextInputTypeNone());
|
| + gfx::Rect screen_bounds(GetTextInputClient()->GetCaretBounds());
|
| +
|
| + HWND attached_window = GetAttachedWindowHandle(client);
|
| + // TODO(ime): see comment in TextInputClient::GetCaretBounds(), this
|
| + // conversion shouldn't be necessary.
|
| + RECT r = {};
|
| + GetClientRect(attached_window, &r);
|
| + POINT window_point = { screen_bounds.x(), screen_bounds.y() };
|
| + ScreenToClient(attached_window, &window_point);
|
| + gfx::Rect caret_rect(gfx::Point(window_point.x, window_point.y),
|
| + screen_bounds.size());
|
| + imm32_manager_.UpdateCaretRect(attached_window, caret_rect);
|
| }
|
| -
|
| - // The current text input type should not be NONE if |client| is focused.
|
| - DCHECK(!IsTextInputTypeNone());
|
| - gfx::Rect screen_bounds(GetTextInputClient()->GetCaretBounds());
|
| -
|
| - HWND attached_window = GetAttachedWindowHandle(client);
|
| - // TODO(ime): see comment in TextInputClient::GetCaretBounds(), this
|
| - // conversion shouldn't be necessary.
|
| - RECT r;
|
| - GetClientRect(attached_window, &r);
|
| - POINT window_point = { screen_bounds.x(), screen_bounds.y() };
|
| - ScreenToClient(attached_window, &window_point);
|
| - imm32_manager_.UpdateCaretRect(
|
| - attached_window,
|
| - gfx::Rect(gfx::Point(window_point.x, window_point.y),
|
| - screen_bounds.size()));
|
| + InputMethodWin::OnCaretBoundsChanged(client);
|
| }
|
|
|
| void InputMethodIMM32::CancelComposition(const TextInputClient* client) {
|
|
|