Skip to content

Commit

Permalink
[Promise Icons] Stop showing accessible name in Launcher item tooltip
Browse files Browse the repository at this point in the history
Currently, Launcher promise items have tooltips which show the
accessible name (i.e. text announced by the screenreader). UX has
explicitly advised against this, so this CL aims to fix this behaviour.

This CL removes the line that sets the tooltip_text to the accessible
name. In regular Launcher items, display_name is always the same as the
full_name, so the logic was never triggered anyway. However, in promise
app items, the display_name always differs from the full_name
(accessible name) which results in the accessible name being set for
the tooltip. Hence, we will remove the tooltip_text_ attribute and let
the tooltip fallback to default behaviour of showing the item title.

Bug: b/305140229
Change-Id: I0f3101cac5fc3ec3691d59ec46bce00e1ac2accc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4976359
Commit-Queue: Vivian Pao <vpao@google.com>
Reviewed-by: Toni Barzic <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1216714}
  • Loading branch information
vpao-g authored and Chromium LUCI CQ committed Oct 29, 2023
1 parent b0d28b8 commit fe8e88e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
3 changes: 0 additions & 3 deletions ash/app_list/views/app_list_item_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1124,8 +1124,6 @@ void AppListItemView::SetItemName(const std::u16string& display_name,
title_->SetText(display_name);
}

tooltip_text_ = display_name == full_name ? std::u16string() : full_name;

// Use full name for accessibility.
SetAccessibleName(
is_folder_ ? l10n_util::GetStringFUTF16(
Expand Down Expand Up @@ -1716,7 +1714,6 @@ std::u16string AppListItemView::GetTooltipText(const gfx::Point& p) const {
// tooltip, so we only temporarily enable it to get the tooltip text from the
// label, then disable it again.
title_->SetHandlesTooltips(true);
title_->SetTooltipText(tooltip_text_);
std::u16string tooltip = title_->GetTooltipText(p);
title_->SetHandlesTooltips(false);
if (new_install_dot_ && new_install_dot_->GetVisible() && !is_folder_) {
Expand Down
2 changes: 0 additions & 2 deletions ash/app_list/views/app_list_item_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,6 @@ class ASH_EXPORT AppListItemView : public views::Button,
// Whether `item_menu_model_adapter_` was shown via key event.
bool menu_show_initiated_from_key_ = false;

std::u16string tooltip_text_;

// A timer to defer showing drag UI when mouse is pressed.
base::OneShotTimer mouse_drag_timer_;
// A timer to defer showing drag UI when the app item is touch pressed.
Expand Down

0 comments on commit fe8e88e

Please sign in to comment.