Chromium Code Reviews| 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..efd3e944afb18aba202a2d0fe2736bd42b5959ce |
| --- /dev/null |
| +++ b/components/arc/common/voice_interaction.mojom |
| @@ -0,0 +1,69 @@ |
| +// 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; |
|
hidehiko
2017/03/10 06:14:50
Is there a case that only some part of children ha
Muyuan
2017/03/10 22:36:10
Sure. How about using Optional<T> for this?
Luis Héctor Chávez
2017/03/13 17:39:34
Optional<T> makes more sense.
|
| + |
| + // Geometry of the view in pixels |
| + int32 x; |
| + int32 y; |
| + int32 width; |
| + int32 height; |
| + |
| + // Text of the view in utf-16 encoding |
|
hidehiko
2017/03/10 06:14:50
Could you comment the reason why uint8 is used to
Muyuan
2017/03/10 22:36:10
In Chromium, strings seem to be always little endi
|
| + array<uint8> text; |
| + |
| + // 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 position of the selection, inclusive. |
|
hidehiko
2017/03/10 06:14:50
Because of inconsistency of encoding "utf-16" and
Muyuan
2017/03/10 22:36:10
Done.
|
| + 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 { |
| + CaptureFocusedWindow@0() => (array<uint8> png_data); |
|
hidehiko
2017/03/10 06:14:50
because mojo is an interface between Chrome and AR
Muyuan
2017/03/10 22:36:10
Done.
|
| + GetVoiceInteractionStructure@1() => (VoiceInteractionStructure structure); |
| +}; |
| + |
| +// Connects with Android system server. |
| +// Next method ID:2 |
| +interface VoiceInteractionCaptureInstance { |
| + Init@0(VoiceInteractionHost host_ptr); |
| + StartVoiceInteractionSession@1(); |
| +}; |
| + |
| +// Connects with ArcHome. |
| +// Next method ID: 1 |
| +interface VoiceInteractionArcHomeInstance { |
| + Init@0(VoiceInteractionHost host_ptr); |
| +}; |
| + |
| + |