automation.mojom 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. // Copyright 2021 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 crosapi.mojom;
  5. import "mojo/public/mojom/base/unguessable_token.mojom";
  6. import "mojo/public/mojom/base/values.mojom";
  7. import "ui/accessibility/mojom/ax_action_data.mojom";
  8. import "ui/accessibility/mojom/ax_event.mojom";
  9. import "ui/accessibility/mojom/ax_relative_bounds.mojom";
  10. import "ui/accessibility/mojom/ax_tree_update.mojom";
  11. import "ui/gfx/geometry/mojom/geometry.mojom";
  12. // Interface for automation clients. Implemented by lacros-chrome. Used by
  13. // ash-chrome to enable automation and to perform actions.
  14. // Next version: 3
  15. // Next method id: 7
  16. [Stable, Uuid="8dd5f2a7-c24b-47c3-a096-a5d28c4764bb"]
  17. interface AutomationClient {
  18. // Deprecated.
  19. PerformActionDeprecated@2(
  20. mojo_base.mojom.UnguessableToken tree_id, int32 automation_node_id,
  21. string action_type, int32 request_id,
  22. mojo_base.mojom.DeprecatedDictionaryValue optional_args);
  23. // Enables automation for the client. This will result in the client
  24. // repeatedly calling ReceiveEventPrototype() on the Automation interface.
  25. Enable@0();
  26. // Enables automation for a particular subtree of the client. This will
  27. // result in the client repeatedly calling ReceiveEventPrototype() on the
  28. // Automation interface.
  29. EnableTree@1(mojo_base.mojom.UnguessableToken token);
  30. // Disables automation in the client. This has the effect of turning off
  31. // accessibility within Lacros' instance of AutomationManagerAura. Calling
  32. // this method without calling Enable or calling it multiple times has no
  33. // adverse effects.
  34. [MinVersion=1] Disable@3();
  35. // Forwards the action described by AXActionData to all clients. Actions are
  36. // resolved by each client based on tree id, action type and other action data
  37. // fields.
  38. [MinVersion=1] PerformAction@4(ax.mojom.AXActionData action_data);
  39. // Notifies Lacros when all Ash automation extensions have been unloaded.
  40. [MinVersion=2] NotifyAllAutomationExtensionsGone@5();
  41. // Notifies Lacros when a new automation extension has added a listener.
  42. [MinVersion=2] NotifyExtensionListenerAdded@6();
  43. };
  44. // Interface for automation. Implemented by ash-chrome.
  45. // Next version: 5
  46. // Next method id: 6
  47. [Stable, Uuid="356a895e-b41a-4c45-9336-d8dc6d332f98"]
  48. interface Automation {
  49. // Deprecated.
  50. RegisterAutomationClientDeprecated@0(
  51. pending_remote<AutomationClient> client,
  52. mojo_base.mojom.UnguessableToken token);
  53. // Deprecated.
  54. ReceiveEventPrototypeDeprecated@1(
  55. string event_bundle, bool root, mojo_base.mojom.UnguessableToken token,
  56. string window_id);
  57. // Forwards an accessibility tree destroyed event from any accessibility tree
  58. // in Lacros to Ash.
  59. [MinVersion=1] DispatchTreeDestroyedEvent@2(
  60. mojo_base.mojom.UnguessableToken tree_id);
  61. // Forwards an action result from any accessibility tree in Lacros to Ash.
  62. [MinVersion=2] DispatchActionResult@3(
  63. ax.mojom.AXActionData data, bool result);
  64. // Forwards an event from any accessibility tree in Lacros to Ash.
  65. [MinVersion=3] DispatchAccessibilityEvents@4(
  66. mojo_base.mojom.UnguessableToken tree_id,
  67. array<ax.mojom.AXTreeUpdate> updates,
  68. gfx.mojom.Point mouse_location,
  69. array<ax.mojom.AXEvent> events);
  70. // Dispatches a location change for a specific node. Currently used by Blink
  71. // in RenderAccessibilityHost::HandleAXLocationChanges.
  72. [MinVersion=4] DispatchAccessibilityLocationChange@5(
  73. mojo_base.mojom.UnguessableToken tree_id,
  74. int32 node_id,
  75. ax.mojom.AXRelativeBounds bounds);
  76. };
  77. // A factory living in the Ash process which brokers connections to other
  78. // processes for automation.
  79. // Next version: 1
  80. // Next method id: 1
  81. [Stable, Uuid="87004779-69b3-4f35-980b-be259f002ac7"]
  82. interface AutomationFactory {
  83. // A binder which sends accessibility data, and receives accessibility actions
  84. // (e.g. Lacros).
  85. BindAutomation@0(
  86. pending_remote<AutomationClient> automation_client,
  87. pending_receiver<Automation> automation);
  88. };