Skip to content

Commit

Permalink
Fix ChromeVox announcement for unnamed folder
Browse files Browse the repository at this point in the history
Changes:
On accessibility focus, unnamed folder should announce "Folder unnamed"
instead of "Folder".

Bug: 359350
Change-Id: If151567a1ce1fe2e531d7b1a92e307b0e9223563
Reviewed-on: https://chromium-review.googlesource.com/c/1418490
Reviewed-by: Alex Newcomer <newcomer@chromium.org>
Commit-Queue: Weidong Guo <weidongg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#623813}
  • Loading branch information
Weidong Guo authored and Commit Bot committed Jan 17, 2019
1 parent 2f6e3bb commit c4dfb31
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ash/app_list/views/app_list_item_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -394,19 +394,21 @@ void AppListItemView::SetAsAttemptedFolderTarget(bool is_target_folder) {

void AppListItemView::SetItemName(const base::string16& display_name,
const base::string16& full_name) {
if (is_folder_ && display_name.empty()) {
title_->SetText(ui::ResourceBundle::GetSharedInstance().GetLocalizedString(
IDS_APP_LIST_FOLDER_NAME_PLACEHOLDER));
} else {
const base::string16 folder_name_placeholder =
ui::ResourceBundle::GetSharedInstance().GetLocalizedString(
IDS_APP_LIST_FOLDER_NAME_PLACEHOLDER);
if (is_folder_ && display_name.empty())
title_->SetText(folder_name_placeholder);
else
title_->SetText(display_name);
}

tooltip_text_ = display_name == full_name ? base::string16() : full_name;

// Use full name for accessibility.
SetAccessibleName(
is_folder_ ? l10n_util::GetStringFUTF16(
IDS_APP_LIST_FOLDER_BUTTON_ACCESSIBILE_NAME, full_name)
IDS_APP_LIST_FOLDER_BUTTON_ACCESSIBILE_NAME,
full_name.empty() ? folder_name_placeholder : full_name)
: full_name);
Layout();
}
Expand Down

0 comments on commit c4dfb31

Please sign in to comment.