Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1007)

Unified Diff: ui/base/ime/input_method_imm32.cc

Issue 48393003: Add InputMethodObserver support into InputMethodBase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix -Werror=sign-compare Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/ime/input_method_ibus.cc ('k') | ui/base/ime/input_method_linux_x11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « ui/base/ime/input_method_ibus.cc ('k') | ui/base/ime/input_method_linux_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698