0

[Quick Share v2][A11y] Add Quick Share tile, icon labels

Add tooltips to the Quick Share quick settings tile and icon.
These tooltips double as labels announced when Chromevox is enabled
and the tile, icon are tabbed over/the icon is toggled.

Screencast (18s)
----------------
http://screencast/cast/NDk4MTA0MTkxMDUxMzY2NHw3ZjUzZjdjNi01MA

Tested: manually via DUT, see screencast.
Fixed: 393169139
Fixed: 393159369
Change-Id: Id77aa958da448380ecd564d744ad57c6fbdf1d74
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6228211
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Commit-Queue: Brando Socarras <brandosocarras@google.com>
Cr-Commit-Position: refs/heads/main@{#1415951}
This commit is contained in:
Brando Socarras
2025-02-04 17:44:43 -08:00
committed by Chromium LUCI CQ
parent 9a59a5fb5b
commit cf21902f02
4 changed files with 22 additions and 0 deletions

@ -452,6 +452,12 @@ Style notes:
<message name="IDS_ASH_STATUS_TRAY_NEARBY_SHARE_BUTTON_LABEL" desc="The shorter label used for the button in the status tray to toggle Nearby Share high visibility mode, which makes the device visible to all nearby devices for file sharing.">
Nearby visibility
</message>
<message name="IDS_ASH_STATUS_TRAY_NEARBY_SHARE_ICON_TOOLTIP" desc="Quick Share tile icon tooltip.">
Toggle Quick Share. Quick Share is <ph name="quick_share_state">$1<ex>On</ex></ph>
</message>
<message name="IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_TOOLTIP" desc="Quick Share tile tooltip.">
Show Quick Share settings
</message>
<message name="IDS_ASH_STATUS_TRAY_NEARBY_SHARE_DETAILED_VIEW_SETTINGS_BUTTON_TOOLTIP" desc="Settings button tooltip.">
Quick Share settings
</message>

@ -0,0 +1 @@
2873b1bb162582d8ea4146e24d3e1adabaa774f2

@ -0,0 +1 @@
b989e50452d73a657a0423535febbe97345f3ecb

@ -40,6 +40,14 @@ std::u16string RemainingTimeString(base::TimeDelta remaining_time) {
static_cast<int>(remaining_time.InSeconds()) + 1);
}
std::u16string IconTooltipString(bool is_enabled) {
return l10n_util::GetStringFUTF16(
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_ICON_TOOLTIP,
l10n_util::GetStringUTF16(
is_enabled ? IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_ON
: IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_OFF));
}
} // namespace
NearbyShareFeaturePodController::NearbyShareFeaturePodController(
@ -99,6 +107,9 @@ std::unique_ptr<FeatureTile> NearbyShareFeaturePodController::CreateTile(
base::BindRepeating(&NearbyShareFeaturePodController::OnIconPressed,
weak_ptr_factory_.GetWeakPtr()));
tile_->SetTooltipText(l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_TOOLTIP));
// Set tile appearance.
UpdateQSv2Button();
} else {
@ -225,6 +236,7 @@ void NearbyShareFeaturePodController::ToggleTileOn() {
auto& on_icon = nearby_share_delegate_->GetIcon(/*on_icon=*/true);
tile_->SetVectorIcon(on_icon.is_empty() ? kQuickSettingsNearbyShareOnIcon
: on_icon);
tile_->SetIconButtonTooltipText(IconTooltipString(/*is_enabled=*/true));
tile_->SetToggled(true);
if (nearby_share_delegate_->IsHighVisibilityOn()) {
@ -259,6 +271,8 @@ void NearbyShareFeaturePodController::ToggleTileOff() {
tile_->SetVectorIcon(off_icon.is_empty() ? kQuickSettingsNearbyShareOffIcon
: off_icon);
tile_->SetToggled(false);
tile_->SetIconButtonTooltipText(IconTooltipString(/*is_enabled=*/false));
tile_->SetSubLabel(l10n_util::GetStringUTF16(
IDS_ASH_STATUS_TRAY_NEARBY_SHARE_TILE_LABEL_OFF));
}