Plumb through Blink accessibility intents into chrome.automation
This change also adds missing param traits for ui::AXEventIntent which was
already part of ui::AXEvent. The Blink renderer -> browser IPC has been fully
transitioned to mojo, but the browser -> extension renderer hasn't, so we need
to keep maintaining legacy IPC including param traits in
ui/accessibility/ax_param_traits*. It was missed previously because no clients
of this member existed from the extension renderer.
[email protected], [email protected]
AX-Relnotes: n/a
Test: manually verify intents appear as part of typing into a text field.
Change-Id: Iba4bdafbfd56399c7467721faf845baf393cdda6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2185511
Commit-Queue: David Tseng <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Akihiro Ota <[email protected]>
Reviewed-by: Nektarios Paisios <[email protected]>
Cr-Commit-Position: refs/heads/master@{#768890}
diff --git a/ui/accessibility/PRESUBMIT.py b/ui/accessibility/PRESUBMIT.py
index 15c4f2c3..51a5469 100644
--- a/ui/accessibility/PRESUBMIT.py
+++ b/ui/accessibility/PRESUBMIT.py
@@ -149,6 +149,12 @@
'DefaultActionVerb', errs, output_api)
CheckMatchingEnum(ax_enums, 'MarkerType', automation_enums,
'MarkerType', errs, output_api)
+ CheckMatchingEnum(ax_enums, 'Command', automation_enums,
+ 'EventCommandType', errs, output_api)
+ CheckMatchingEnum(ax_enums, 'TextBoundary', automation_enums,
+ 'EventTextBoundaryType', errs, output_api)
+ CheckMatchingEnum(ax_enums, 'MoveDirection', automation_enums,
+ 'EventMoveDirectionType', errs, output_api)
return errs
# Given a full path to c++ header, return an array of the first static
diff --git a/ui/accessibility/ax_param_traits_macros.h b/ui/accessibility/ax_param_traits_macros.h
index 6c5315f..d33912c7 100644
--- a/ui/accessibility/ax_param_traits_macros.h
+++ b/ui/accessibility/ax_param_traits_macros.h
@@ -9,6 +9,7 @@
#include "ipc/ipc_message_macros.h"
#include "ui/accessibility/ax_enums.mojom-shared.h"
#include "ui/accessibility/ax_event.h"
+#include "ui/accessibility/ax_event_intent.h"
#include "ui/accessibility/ax_export.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/accessibility/ax_tree_id.h"
@@ -36,6 +37,11 @@
IPC_ENUM_TRAITS_MAX_VALUE(ax::mojom::TextAffinity,
ax::mojom::TextAffinity::kMaxValue)
IPC_ENUM_TRAITS_MAX_VALUE(ax::mojom::EventFrom, ax::mojom::EventFrom::kMaxValue)
+IPC_ENUM_TRAITS_MAX_VALUE(ax::mojom::Command, ax::mojom::Command::kMaxValue)
+IPC_ENUM_TRAITS_MAX_VALUE(ax::mojom::TextBoundary,
+ ax::mojom::TextBoundary::kMaxValue)
+IPC_ENUM_TRAITS_MAX_VALUE(ax::mojom::MoveDirection,
+ ax::mojom::MoveDirection::kMaxValue)
IPC_STRUCT_TRAITS_BEGIN(ui::AXRelativeBounds)
IPC_STRUCT_TRAITS_MEMBER(offset_container_id)
@@ -47,9 +53,16 @@
IPC_STRUCT_TRAITS_MEMBER(event_type)
IPC_STRUCT_TRAITS_MEMBER(id)
IPC_STRUCT_TRAITS_MEMBER(event_from)
+ IPC_STRUCT_TRAITS_MEMBER(event_intents)
IPC_STRUCT_TRAITS_MEMBER(action_request_id)
IPC_STRUCT_TRAITS_END()
+IPC_STRUCT_TRAITS_BEGIN(ui::AXEventIntent)
+ IPC_STRUCT_TRAITS_MEMBER(command)
+ IPC_STRUCT_TRAITS_MEMBER(text_boundary)
+ IPC_STRUCT_TRAITS_MEMBER(move_direction)
+IPC_STRUCT_TRAITS_END()
+
IPC_STRUCT_TRAITS_BEGIN(ui::AXNodeData)
IPC_STRUCT_TRAITS_MEMBER(id)
IPC_STRUCT_TRAITS_MEMBER(role)