0

[views-ax] Remove a11y getters from ClipboardHistoryItemView

This change removes all usage of accessibility getters from the
ClipboardHistoryItemView's GetAccessibleNodeData method. It doesn't
introduce a change in behavior, since the attributes exposed to
platform accessibility APIs through GetAccessibleNodeData will still
be the same, just without the cache usage.

This change is needed because, with the ViewsAX project, we aim to
maintain a cache of all accessibility attributes to ensure this cache
is only active when needed.

The output of the View::GetAccessibleNodeData overrides will soon be
used to initialize the cache, so they shouldn't be using the cache or
modifying the cache.

This CL is part of the ViewsAX project:
https://docs.google.com/document/d/1Ku7HOyDsiZem1yaV6ccZ-tz3lO2XR2NEcm8HjR6d-VY/edit#heading=h.ke1u3utej413


Bug: 325137417
Change-Id: I19e8c75db660fbefe9a65085083c849452364e6a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5626221
Reviewed-by: Andrew Xu <andrewxu@chromium.org>
Commit-Queue: Andrew Xu <andrewxu@chromium.org>
Reviewed-by: Benjamin Beaudry <benjamin.beaudry@microsoft.com>
Auto-Submit: Vinay Singh <vinaysingh@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1320129}
This commit is contained in:
Vinay Singh
2024-06-27 01:28:25 +00:00
committed by Chromium LUCI CQ
parent 6ae7ca7f26
commit 76165e1dfd

@ -420,16 +420,6 @@ void ClipboardHistoryItemView::GetAccessibleNodeData(ui::AXNodeData* data) {
View::GetAccessibleNodeData(data);
data->role = ax::mojom::Role::kMenuItem;
// TODO(crbug.com/325137417): Instead of retrieving the accessible name from
// the accessibility cache, we will have to compute it here to initialize the
// cache with it. This will be fixed on by the ViewsAX crew.
std::u16string ax_name = GetViewAccessibility().GetCachedName();
if (ax_name.empty()) {
data->SetNameExplicitlyEmpty();
} else {
data->SetNameChecked(ax_name);
}
// In fitting with existing conventions for menu items, we treat clipboard
// history items as "selected" from an accessibility standpoint if pressing
// Enter will perform the item's default expected action: pasting.