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

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

Issue 641243005: Support a private event - inputMethodPrivate.onCompositionBoundsChanged so that component IME exten… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits + unit test Created 6 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/chromeos/mock_ime_engine_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/input_method_chromeos.cc
diff --git a/ui/base/ime/input_method_chromeos.cc b/ui/base/ime/input_method_chromeos.cc
index 37a9c3c7612a5e242b4c06b1aefb14fe002f46b3..a867afac42841091751dfc899198c9288ad6eff6 100644
--- a/ui/base/ime/input_method_chromeos.cc
+++ b/ui/base/ime/input_method_chromeos.cc
@@ -184,12 +184,15 @@ void InputMethodChromeOS::OnCaretBoundsChanged(const TextInputClient* client) {
return;
// The current text input type should not be NONE if |context_| is focused.
+ DCHECK(client == GetTextInputClient());
DCHECK(!IsTextInputTypeNone());
- const gfx::Rect rect = GetTextInputClient()->GetCaretBounds();
+ const gfx::Rect rect = client->GetCaretBounds();
gfx::Rect composition_head;
- if (!GetTextInputClient()->GetCompositionCharacterBounds(0,
- &composition_head)) {
+ if (client->GetCompositionCharacterBounds(0, &composition_head)) {
+ if (GetEngine())
+ GetEngine()->SetCompositionBounds(composition_head);
+ } else {
composition_head = rect;
}
@@ -202,9 +205,9 @@ void InputMethodChromeOS::OnCaretBoundsChanged(const TextInputClient* client) {
gfx::Range text_range;
gfx::Range selection_range;
base::string16 surrounding_text;
- if (!GetTextInputClient()->GetTextRange(&text_range) ||
- !GetTextInputClient()->GetTextFromRange(text_range, &surrounding_text) ||
- !GetTextInputClient()->GetSelectionRange(&selection_range)) {
+ if (!client->GetTextRange(&text_range) ||
+ !client->GetTextFromRange(text_range, &surrounding_text) ||
+ !client->GetSelectionRange(&selection_range)) {
previous_surrounding_text_.clear();
previous_selection_range_ = gfx::Range::InvalidRange();
return;
« no previous file with comments | « ui/base/ime/chromeos/mock_ime_engine_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698