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

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

Issue 2876693004: Implement GetTextFromRange(), GetTextRange() and GetSelectionRange() for ArcImeService. (Closed)
Patch Set: add TODOs in ime.mojom 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
« no previous file with comments | « components/arc/DEPS ('k') | components/arc/common/ime.typemap » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/common/ime.mojom
diff --git a/components/arc/common/ime.mojom b/components/arc/common/ime.mojom
index ae6d4e5bb9c79ba69be1ce09644b5f012b69be47..fd945302c3c7c598e474265e02de4626fee354f4 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;
@@ -24,6 +24,7 @@ enum TextInputType {
DATETIME,
};
+// TODO(yhanada): Switch to use gfx.mojom.Rect. See crbug.com/723224.
// Represents the text insertion points in the container screen coordinates.
struct CursorRect {
int32 left;
@@ -32,6 +33,16 @@ struct CursorRect {
int32 bottom;
};
+// TODO(yhanada): Switch to use gfx.mojom.Range. See crbug.com/723224.
+// 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 +66,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.
+ );
};
// Next method ID: 6
« no previous file with comments | « components/arc/DEPS ('k') | components/arc/common/ime.typemap » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698