ax_assistant_structure.mojom 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. module ax.mojom;
  5. import "mojo/public/mojom/base/string16.mojom";
  6. import "ui/gfx/geometry/mojom/geometry.mojom";
  7. import "ui/gfx/range/mojom/range.mojom";
  8. import "url/mojom/url.mojom";
  9. // Tree structure for assistant. The tree is represented as a flat array of
  10. // nodes, each containing a children_indices vector that points to its child
  11. // nodes. The purpose is to work around max depth restriction of recursive
  12. // data structure in mojo.
  13. struct AssistantTree {
  14. array<AssistantNode> nodes;
  15. };
  16. // Represents view structure to be passed to assistant. The view structure is
  17. // synthesized from the AXNode.
  18. struct AssistantNode {
  19. array<int32> children_indices;
  20. // Geometry of the view in pixels
  21. gfx.mojom.Rect rect;
  22. // Text of the view.
  23. mojo_base.mojom.String16 text;
  24. // Text properties
  25. float text_size;
  26. uint32 color;
  27. uint32 bgcolor;
  28. bool bold;
  29. bool italic;
  30. bool underline;
  31. bool line_through;
  32. // Selected portion of the text.
  33. gfx.mojom.Range? selection;
  34. // Fake Android view class name of the element. Each node is assigned
  35. // a closest approximation of Android's views to keep the server happy.
  36. string class_name;
  37. // Accessibility functionality of the node inferred from DOM or based on HTML
  38. // role attribute.
  39. string? role;
  40. };
  41. // Additional information to current context.
  42. struct AssistantExtra {
  43. url.mojom.Url url;
  44. gfx.mojom.Rect bounds_pixel;
  45. mojo_base.mojom.String16 title;
  46. };
  47. // Assistant structure, including Assistant tree and extra.
  48. struct AssistantStructure {
  49. AssistantTree? assistant_tree;
  50. AssistantExtra? assistant_extra;
  51. };