Index: components/arc/common/voice_interaction.mojom |
diff --git a/components/arc/common/voice_interaction.mojom b/components/arc/common/voice_interaction.mojom |
new file mode 100644 |
index 0000000000000000000000000000000000000000..92029f495d1070c5d528a2b9982bc4a9b52ae72c |
--- /dev/null |
+++ b/components/arc/common/voice_interaction.mojom |
@@ -0,0 +1,76 @@ |
+// 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; |
+ |
+// 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. |
+struct VoiceInteractionStructure { |
+ // Whether this is a valid response |
+ bool success; |
Luis Héctor Chávez
2017/03/13 17:39:34
remove per the Optional<T> discussion.
Muyuan
2017/03/14 01:38:14
OK.. after a second look, it seems that the mojo g
Luis Héctor Chávez
2017/03/14 02:11:33
it does: it generates a null Object. unfortunately
Muyuan
2017/03/14 21:37:00
Done.
|
+ |
+ // Geometry of the view in pixels |
+ int32 x; |
Luis Héctor Chávez
2017/03/13 17:39:35
Can this be a https://cs.chromium.org/chromium/src
Muyuan
2017/03/14 01:38:14
does geometry exists in Java side?
Luis Héctor Chávez
2017/03/14 02:11:33
on further inspection, you should be able to use t
Muyuan
2017/03/14 21:37:00
Done.
|
+ int32 y; |
+ int32 width; |
+ int32 height; |
+ |
+ // Text of the view in utf-16 encoding |
+ array<uint8> text; |
Luis Héctor Chávez
2017/03/13 17:39:34
Can this be https://cs.chromium.org/chromium/src/m
Muyuan
2017/03/14 01:38:14
same question as above..
Luis Héctor Chávez
2017/03/14 02:11:33
you might need to do a similar trick as with Scree
|
+ |
+ // Text properties |
+ float text_size; |
+ int32 color; |
+ int32 bgcolor; |
+ bool bold; |
+ bool italic; |
+ bool underline; |
+ bool line_through; |
+ |
+ // Is the text selected |
+ bool has_selection; |
+ // Start and end unicode character position of the selection, inclusive. |
+ int32 start_selection; |
+ int32 end_selection; |
Luis Héctor Chávez
2017/03/13 17:39:35
Can you extract the start_selection and end_select
Muyuan
2017/03/14 01:38:14
So looks like optional is not implemented in the J
|
+ |
+ // 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: 2 |
+interface VoiceInteractionHost { |
+ // Returns a screenshot of current focused window or empty bytes if |
+ // no window is focused. |
+ CaptureFocusedWindow@0() => (array<uint8> png_data); |
Luis Héctor Chávez
2017/03/13 17:39:34
What is the relationship between CaptureFocusedWin
Muyuan
2017/03/14 01:38:14
These are relatively independent by now.. One is c
Luis Héctor Chávez
2017/03/14 02:11:33
the problem is that substantially changing interfa
|
+ |
+ // Returns view hierarchy of current window represented as |
+ // VoiceInteractionStructure. |
+ GetVoiceInteractionStructure@1() => (VoiceInteractionStructure structure); |
+}; |
+ |
+// Connects with Android system server. |
+// Next method ID:2 |
+interface VoiceInteractionCaptureInstance { |
+ Init@0(VoiceInteractionHost host_ptr); |
+ |
+ // Starts the voice interaction session in container. |
+ StartVoiceInteractionSession@1(); |
+}; |
+ |
+// Connects with ArcHome. |
+// Next method ID: 1 |
+interface VoiceInteractionArcHomeInstance { |
+ Init@0(VoiceInteractionHost host_ptr); |
+}; |
+ |
Luis Héctor Chávez
2017/03/13 17:41:02
remove trailing empty lines.
Muyuan
2017/03/14 01:38:14
Done.
|
+ |