Commit 41e1e57a authored by David Tseng's avatar David Tseng Committed by Commit Bot

Clarifies event helpers in automation_api_util

Rename IsEventTypeHandledByAXEventGenerator -> ShouldIgnoreAXEvent to
mirror the variant for AX event generator.

R=dmazzoni@chromium.org

AX-Relnotes: n/a
Test: existing tests
Change-Id: I5600ac87fb4369330c27c0b52c70ab112958b41a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2464981
Commit-Queue: David Tseng <dtseng@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816293}
parent 0541245e
......@@ -14,7 +14,7 @@
namespace extensions {
bool IsEventTypeHandledByAXEventGenerator(ax::mojom::Event event_type) {
bool ShouldIgnoreAXEvent(ax::mojom::Event event_type) {
// Important note: if you are getting here as a result of a compilation error
// while adding or removing enum values from ax::mojom::Event, please ensure
// you keep that enum in sync with EventType in
......
......@@ -11,7 +11,7 @@
namespace extensions {
bool IsEventTypeHandledByAXEventGenerator(ax::mojom::Event event_type);
bool ShouldIgnoreAXEvent(ax::mojom::Event event_type);
bool ShouldIgnoreGeneratedEvent(ui::AXEventGenerator::Event event_type);
......
......@@ -145,9 +145,8 @@ bool AutomationAXTreeWrapper::OnAccessibilityEvents(
event.event_type == ax::mojom::Event::kBlur)
continue;
// Send some events directly from the event message, if they're not
// handled by AXEventGenerator yet.
if (!IsEventTypeHandledByAXEventGenerator(event.event_type)) {
// Send some events directly.
if (!ShouldIgnoreAXEvent(event.event_type)) {
owner_->SendAutomationEvent(event_bundle.tree_id,
event_bundle.mouse_location, event);
}
......
......@@ -155,7 +155,7 @@ api::automation::EventType AXEventToAutomationEventType(
for (int i = static_cast<int>(ax::mojom::Event::kMinValue);
i <= static_cast<int>(ax::mojom::Event::kMaxValue); i++) {
auto ax_event_type = static_cast<ax::mojom::Event>(i);
if (IsEventTypeHandledByAXEventGenerator(ax_event_type) ||
if (ShouldIgnoreAXEvent(ax_event_type) ||
ax_event_type == ax::mojom::Event::kNone) {
enum_map->emplace_back(api::automation::EVENT_TYPE_NONE);
continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment