0

[gtm] Accessibility update

1. For tasks, consider the case where the tasks can have empty titles.
2. Use localization tooltip text for expand buttons.

Bug: b/338917100
Change-Id: Ic66938dc4af1e61065609d4816a2b3e4988b18ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5593905
Commit-Queue: Wen-Chien Wang <wcwang@chromium.org>
Reviewed-by: Artsiom Mitrokhin <amitrokhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1309738}
This commit is contained in:
Wen-Chien Wang
2024-06-04 01:46:40 +00:00
committed by Chromium LUCI CQ
parent b48a6110a7
commit 19189bc8eb
8 changed files with 31 additions and 8 deletions

@ -7630,6 +7630,18 @@ New install
<message name="IDS_GLANCEABLES_TASKS_ASSIGNED_TASK_NOTICE" desc="The glanceable displays tasks fetched from Google Tasks API. Some of them can be created and assigned by other users (e.g. via Google Docs). This is a privacy notice warning that any changes will be visible to others (e.g. everyone having access to the same origin document).">
Others can see changes that you make to this task
</message>
<message name="IDS_GLANCEABLES_TASKS_EXPAND_BUTTON_EXPAND_TOOLTIP" desc="The tooltip for the expand button, indicating action to expand the glanceables task UI">
Expand Google Tasks
</message>
<message name="IDS_GLANCEABLES_TASKS_EXPAND_BUTTON_COLLAPSE_TOOLTIP" desc="The tooltip for the expand button, indicating action to collapse the glanceables task UI">
Collapse Google Tasks
</message>
<message name="IDS_GLANCEABLES_CLASSROOM_EXPAND_BUTTON_EXPAND_TOOLTIP" desc="The tooltip for the expand button, indicating action to expand the glanceables classroom UI">
Expand Google Classroom
</message>
<message name="IDS_GLANCEABLES_CLASSROOM_EXPAND_BUTTON_COLLAPSE_TOOLTIP" desc="The tooltip for the expand button, indicating action to collapse the glanceables classroom UI">
Collapse Google Classroom
</message>
<!-- Do Not Disturb notification -->
<message name="IDS_ASH_DO_NOT_DISTURB_NOTIFICATION_TITLE" desc="Label used for the notification that shows up when the 'Do Not Disturb' feature is enabled.">

@ -0,0 +1 @@
0c526885c45a929e3150d0e40d7db9c84c8a4116

@ -0,0 +1 @@
b81644421d51d860340875a15b9827ce885d62e9

@ -0,0 +1 @@
81885ad08fcdbd48393bf357a4d1540b3d02c92c

@ -0,0 +1 @@
b9ac89ac4cd9ae2046201d9532b1563ca9afdd5c

@ -131,14 +131,14 @@ class ClassroomExpandButton : public CounterExpandButton {
std::u16string GetExpandedStateTooltipText() override {
// The tooltip tells users that clicking on the button will collapse the
// Classroom view.
// TODO(b/338917100): Update this when the string is ready.
return u"Collapse Classroom";
return l10n_util::GetStringUTF16(
IDS_GLANCEABLES_CLASSROOM_EXPAND_BUTTON_COLLAPSE_TOOLTIP);
}
std::u16string GetCollapsedStateTooltipText() override {
// The tooltip tells users that clicking on the button will expand the
// Classroom view.
// TODO(b/338917100): Update this when the string is ready.
return u"Expand Classroom";
return l10n_util::GetStringUTF16(
IDS_GLANCEABLES_CLASSROOM_EXPAND_BUTTON_EXPAND_TOOLTIP);
}
};

@ -288,6 +288,13 @@ class GlanceablesTaskView::TaskTitleButton : public views::LabelButton {
.DeriveWithStyle(completed ? gfx::Font::FontStyle::STRIKE_THROUGH
: gfx::Font::FontStyle::NORMAL));
}
void SetText(const std::u16string& text) override {
views::LabelButton::SetText(text);
SetAccessibleName(text, text.empty()
? ax::mojom::NameFrom::kAttributeExplicitlyEmpty
: ax::mojom::NameFrom::kAttribute);
}
};
BEGIN_METADATA(GlanceablesTaskView, TaskTitleButton)

@ -133,14 +133,14 @@ class TasksExpandButton : public CounterExpandButton {
std::u16string GetExpandedStateTooltipText() override {
// The tooltip tells users that clicking on the button will collapse the
// Tasks view.
// TODO(b/338917100): Update this when the string is ready.
return u"Collapse Tasks";
return l10n_util::GetStringUTF16(
IDS_GLANCEABLES_TASKS_EXPAND_BUTTON_COLLAPSE_TOOLTIP);
}
std::u16string GetCollapsedStateTooltipText() override {
// The tooltip tells users that clicking on the button will expand the
// Tasks view.
// TODO(b/338917100): Update this when the string is ready.
return u"Expand Tasks";
return l10n_util::GetStringUTF16(
IDS_GLANCEABLES_TASKS_EXPAND_BUTTON_EXPAND_TOOLTIP);
}
};