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

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

Issue 858303004: Exposes cursor position to IME extension through chrome.inputMethodPrivate.onCompositionBoundsChang… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « chrome/common/extensions/api/input_method_private.json ('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 a3910b703718fdc7157fd0f1152a61c8d3aefaf8..aef3e9ffd97a0b5d07021c57c2dbdbdde2e8abfb 100644
--- a/ui/base/ime/input_method_chromeos.cc
+++ b/ui/base/ime/input_method_chromeos.cc
@@ -189,19 +189,20 @@ void InputMethodChromeOS::OnCaretBoundsChanged(const TextInputClient* client) {
const gfx::Rect caret_rect = client->GetCaretBounds();
gfx::Rect composition_head;
+ std::vector<gfx::Rect> rects;
if (client->HasCompositionText()) {
- std::vector<gfx::Rect> rects;
uint32 i = 0;
gfx::Rect rect;
while (client->GetCompositionCharacterBounds(i++, &rect))
rects.push_back(rect);
- if (rects.size() > 0) {
- if (GetEngine())
- GetEngine()->SetCompositionBounds(rects);
- composition_head = rects[0];
- }
} else {
- composition_head = caret_rect;
+ rects.push_back(caret_rect);
+ }
+
+ if (rects.size() > 0) {
+ composition_head = rects[0];
+ if (GetEngine())
+ GetEngine()->SetCompositionBounds(rects);
}
chromeos::IMECandidateWindowHandlerInterface* candidate_window =
« no previous file with comments | « chrome/common/extensions/api/input_method_private.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698