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

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

Issue 2731403007: add voice interaction shortcut. (Closed)
Patch Set: add voice interaction shortcut. Created 3 years, 9 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/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..14b18c3d922350f73f512929c16c267779b0da99
--- /dev/null
+++ b/components/arc/common/voice_interaction.mojom
@@ -0,0 +1,74 @@
+// 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;
+
+ // Geometry of the view in pixels
+ int32 x;
+ int32 y;
+ int32 width;
+ int32 height;
+
+ // Text of the view in utf-16 encoding
+ array<uint8> text;
xiyuan 2017/03/14 17:55:31 Do we have to pass utf16 like this? It is not a go
Muyuan 2017/03/14 21:37:01 String16 does not seem to be implemented in Java s
xiyuan 2017/03/15 15:58:15 Acknowledged.
+
+ // 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;
+
+ // 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);
+
+ // 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);
+};

Powered by Google App Engine
This is Rietveld 408576698