Commit 2b0ac471 authored by Jiaquan He's avatar Jiaquan He Committed by Commit Bot

Improve Play Store app search accessibility.

Change the accessibility rating text to the way Play Store is using.

Bug: 756991
Change-Id: I812faf2e74233ba7f7d1407bea19e00bfbf538b9
Reviewed-on: https://chromium-review.googlesource.com/667785
Commit-Queue: Jiaquan He <hejq@google.com>
Reviewed-by: default avatarVadim Tryshev <vadimt@chromium.org>
Reviewed-by: default avatarYury Khmel <khmel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505068}
parent f5a3fe32
......@@ -170,7 +170,7 @@ TEST_P(SearchResultTileItemListViewTest, Basic) {
->child_at(first_child + i * child_step)
->GetAccessibleNodeData(&node_data);
EXPECT_EQ(ui::AX_ROLE_BUTTON, node_data.role);
EXPECT_EQ(base::StringPrintf("PlayStoreApp %d, %d.0, Price %d",
EXPECT_EQ(base::StringPrintf("PlayStoreApp %d, Star rating %d.0, Price %d",
i - kInstalledApps, i + 1 - kInstalledApps,
i - kInstalledApps),
node_data.GetStringAttribute(ui::AX_ATTR_NAME));
......
......@@ -13,7 +13,9 @@
#include "ui/app_list/search_result.h"
#include "ui/app_list/vector_icons/vector_icons.h"
#include "ui/app_list/views/search_result_container_view.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/background.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
......@@ -161,8 +163,12 @@ void SearchResultTileItemView::SetSearchResult(SearchResult* item) {
}
base::string16 accessible_name = title()->text();
if (rating_ && rating_->visible())
accessible_name += base::UTF8ToUTF16(", ") + rating_->text();
if (rating_ && rating_->visible()) {
accessible_name +=
base::UTF8ToUTF16(", ") +
l10n_util::GetStringFUTF16(IDS_APP_ACCESSIBILITY_STAR_RATING_ARC,
rating_->text());
}
if (price_ && price_->visible())
accessible_name += base::UTF8ToUTF16(", ") + price_->text();
SetAccessibleName(accessible_name);
......
......@@ -734,6 +734,9 @@ need to be translated for each locale.-->
<message name="IDS_APP_LIST_PAGE_SWITCHER" desc="Tooltip for page switcher for each page in fullscreen view which shows all apps.">
Page <ph name="selected_page">$1<ex>1</ex></ph> of <ph name="total_page_num">$2<ex>3</ex></ph>
</message>
<message name="IDS_APP_ACCESSIBILITY_STAR_RATING_ARC" desc="Accessibility text for the start rating of a Play Store app.">
Star rating <ph name="RATING_SCORE">$1<ex>5.0</ex></ph>
</message>
<!-- Strings describing the touch calibration UX -->
<message name="IDS_DISPLAY_TOUCH_CALIBRATION_EXIT_LABEL" desc="A message to notify the user about using the escape key to exit the calibration mode.">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment