Index: components/arc/common/voice_interaction_arc_home.mojom |
diff --git a/components/arc/common/voice_interaction_arc_home.mojom b/components/arc/common/voice_interaction_arc_home.mojom |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5f08fdde2e98c751888bc040b6f4448f40249e97 |
--- /dev/null |
+++ b/components/arc/common/voice_interaction_arc_home.mojom |
@@ -0,0 +1,65 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+// |
+// Next MinVersion: 1 |
+ |
+module arc.mojom; |
+ |
+import "mojo/common/string16.mojom"; |
+import "screen_rect.mojom"; |
+ |
+// Represents the start and end unicode char indices of the selected |
+// portion of the text [start, end). |
+struct TextSelection { |
+ int32 start_selection; |
+ int32 end_selection; |
+}; |
+ |
+// Represents view structure to be passed to ARC. The view |
+// structure is synthesized from the AXStructure, which |
+// is a simplified representation of the DOM tree. We |
+// map each node of the AXStructure into a view element. |
+// The naming convention of the fields kept consistent with |
+// AccessibilitySnapshotNode.java used in Android Chromium. |
+struct VoiceInteractionStructure { |
+ // Geometry of the view in pixels |
+ ScreenRect rect; |
+ |
+ // Text of the view. |
+ mojo.common.mojom.String16 text; |
+ |
+ // Text properties |
+ float text_size; |
+ int32 color; |
+ int32 bgcolor; |
+ bool bold; |
+ bool italic; |
+ bool underline; |
+ bool line_through; |
+ |
+ // Selected portion of the text. |
+ TextSelection? selection; |
+ |
+ // Fake Android view class name of the element. Each node is assigned |
+ // a closest approximation of Android's views. |
+ string class_name; |
+ |
+ // Children of current node |
+ array<VoiceInteractionStructure> children; |
+}; |
+ |
+// Handles voice interaction queries from Android. |
+// Next method ID: 1 |
+interface VoiceInteractionArcHomeHost { |
+ // Returns view hierarchy of current window represented as |
+ // VoiceInteractionStructure. Returns empty if the request |
+ // fails. |
+ GetVoiceInteractionStructure@1() => (VoiceInteractionStructure? structure); |
+}; |
+ |
+// Connects with ArcHome. |
+// Next method ID: 1 |
+interface VoiceInteractionArcHomeInstance { |
+ Init@0(VoiceInteractionArcHomeHost host_ptr); |
+}; |