0

CloseAll: Add new readout for close all shortcut.

Test: manual
Change-Id: I93a838cad89a356aba470d5ad76ac2830ae1baf5
Fixed: 1307011
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3643223
Commit-Queue: Sammie Quon <sammiequon@chromium.org>
Auto-Submit: Sammie Quon <sammiequon@chromium.org>
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1002724}
This commit is contained in:
Sammie Quon
2022-05-12 17:54:38 +00:00
committed by Chromium LUCI CQ
parent f00e5af64d
commit 3fb9aa7b6f
3 changed files with 22 additions and 7 deletions

@ -1773,6 +1773,9 @@ This file contains the strings for ash.
<message name="IDS_ASH_OVERVIEW_CLOSABLE_HIGHLIGHT_ITEM_A11Y_EXTRA_TIP" desc="The accessibility tooltip read by screen readers for a close-able overview item.">
Press Ctrl + W to close.
</message>
<message name="IDS_ASH_OVERVIEW_CLOSABLE_DESK_MINIVIEW_A11Y_EXTRA_TIP" desc="The accessibility text read by screen readers for a closeable desk mini view when the close all feature is enabled.">
Press Ctrl + W to combine with <ph name="DESK_NAME">$1<ex>Desk 1</ex></ph>. Press Ctrl + Shift + W to close desk and windows.
</message>
<message name="IDS_ASH_OVERVIEW_WINDOW_CLOSING_A11Y_ALERT" desc="The accessibility alert read by screen readers to alert the user that a window in overview mode is closing.">
Window <ph name="WINDOW_TITILE">$1<ex>1</ex></ph> closed.
</message>

@ -0,0 +1 @@
c0ffe8f27b8c2930819fe7b0648bbf06e1ac1c62

@ -328,14 +328,25 @@ void DeskMiniView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
: IDS_ASH_DESKS_INACTIVE_DESK_MINIVIEW_A11Y_EXTRA_TIP));
}
if (DesksController::Get()->CanRemoveDesks()) {
// TODO(sammiequon): Update this once we get strings from UX writing since
// close all supports Ctrl+Shift+W.
node_data->AddStringAttribute(
ax::mojom::StringAttribute::kDescription,
l10n_util::GetStringUTF8(
IDS_ASH_OVERVIEW_CLOSABLE_HIGHLIGHT_ITEM_A11Y_EXTRA_TIP));
// If the desk can be combined or closed, add a tip to let the user know they
// can use an accelerator.
if (!DesksController::Get()->CanRemoveDesks())
return;
std::string extra_tip;
if (features::IsDesksCloseAllEnabled()) {
const std::u16string target_desk_name =
DesksController::Get()->GetCombineDesksTargetName(desk_);
extra_tip = l10n_util::GetStringFUTF8(
IDS_ASH_OVERVIEW_CLOSABLE_DESK_MINIVIEW_A11Y_EXTRA_TIP,
target_desk_name);
} else {
extra_tip = l10n_util::GetStringUTF8(
IDS_ASH_OVERVIEW_CLOSABLE_HIGHLIGHT_ITEM_A11Y_EXTRA_TIP);
}
node_data->AddStringAttribute(ax::mojom::StringAttribute::kDescription,
extra_tip);
}
void DeskMiniView::OnThemeChanged() {