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

Unified Diff: components/arc/common/ime.mojom

Issue 2876693004: Implement GetTextFromRange(), GetTextRange() and GetSelectionRange() for ArcImeService. (Closed)
Patch Set: save surrounding text even if cursor rect is not changed Created 3 years, 7 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
Index: components/arc/common/ime.mojom
diff --git a/components/arc/common/ime.mojom b/components/arc/common/ime.mojom
index ae6d4e5bb9c79ba69be1ce09644b5f012b69be47..45ee02651b184822fdba2864133e6a607f8edabd 100644
--- a/components/arc/common/ime.mojom
+++ b/components/arc/common/ime.mojom
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Next MinVersion: 5
+// Next MinVersion: 6
module arc.mojom;
@@ -32,6 +32,13 @@ struct CursorRect {
int32 bottom;
};
+// Represents the range in the text. It is an open interval [start, end).
Luis Héctor Chávez 2017/05/15 15:44:26 nit: can you document what these offsets represent
yhanada 2017/05/16 10:02:12 Done.
+[MinVersion=5]
+struct TextRange {
+ uint32 start;
+ uint32 end;
+};
+
// Represents a single segment of text currently composed by IME.
struct CompositionSegment {
// Start offset of the segment in UTF-16 index.
@@ -55,6 +62,21 @@ interface ImeHost {
// Show virtual keyboard of Chrome OS if needed.
[MinVersion=2] ShowImeIfNeeded@3();
+
+ // Notifies Chrome that the cursor position has changed and
+ // also sends surrounding text.
+ //
+ // |text_range|, |text_in_range| and |selection_range| are piggy-backed
+ // into this method because Chrome OS IME tries to retrieve these information
+ // synchronously, so we need to update them all at once to keep consistency.
+ [MinVersion=5] OnCursorRectChangedWithSurroundingText@4(
+ CursorRect rect, // The cursor position.
+ TextRange text_range, // The range of |text_in_range| in the current text
+ // in the editor.
+ string text_in_range, // The text around the cursor.
+ TextRange selection_range // The range of the selected text
+ // in the current text in the editor.
+ );
Luis Héctor Chávez 2017/05/15 15:44:27 nit: Clang-format does not work here, but can you
yhanada 2017/05/16 10:02:12 Done.
};
// Next method ID: 6

Powered by Google App Engine
This is Rietveld 408576698