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

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

Issue 2876693004: Implement GetTextFromRange(), GetTextRange() and GetSelectionRange() for ArcImeService. (Closed)
Patch Set: use typemapping 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..2baed29df3051599a68f7d072c546a9dfa5784e9 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,15 @@ struct CursorRect {
int32 bottom;
};
+// Represents the range in the text. It is an open interval [start, end).
+[MinVersion=5]
+struct TextRange {
+ // Start offset in UTF-16 index.
+ uint32 start;
+ // End offset in UTF-16 index.
+ 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 +64,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.
hidehiko 2017/05/16 10:08:59 Optional: How about using Rect in ui/gfx/geometry/
+ TextRange text_range, // The range of |text_in_range| in the current
hidehiko 2017/05/16 10:08:59 Ditto, for ui/gfx/range/mojo/range.mojom.
+ // 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.
+ );
};
// Next method ID: 6

Powered by Google App Engine
This is Rietveld 408576698