Commit a3bb147e authored by wutao's avatar wutao Committed by Commit Bot

cros: Make ChromeVox pronounce Continue Reading item

This cl adds more descriptive text to ChromeVox when pronoucing the
suggestion chip of Continue Reading.

Bug: 843839, 865051
Test: manual.
Change-Id: I3b7bd36c1c69d43dcc79bde14ae0cbb1c6e78d66
Reviewed-on: https://chromium-review.googlesource.com/1176201Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Tao Wu <wutao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584593}
parent 1e0dfda0
......@@ -10,9 +10,12 @@
#include "ash/app_list/app_list_view_delegate.h"
#include "ash/app_list/model/search/search_result.h"
#include "ash/public/cpp/app_list/app_list_constants.h"
#include "ash/public/cpp/app_list/internal_app_id_constants.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/strings/grit/ui_strings.h"
namespace app_list {
......@@ -97,14 +100,20 @@ void SearchResultSuggestionChipView::UpdateSuggestionChipView() {
if (suggestion_chip_view_) {
suggestion_chip_view_->SetIcon(item_->icon());
suggestion_chip_view_->SetText(item_->title());
return;
}
} else {
app_list::SuggestionChipView::Params params;
params.text = item_->title();
params.icon = item_->icon();
suggestion_chip_view_ = new SuggestionChipView(params, /* listener */ this);
AddChildView(suggestion_chip_view_);
}
base::string16 accessible_name = item_->title();
if (item_->id() == app_list::kInternalAppIdContinueReading) {
accessible_name = l10n_util::GetStringFUTF16(
IDS_APP_LIST_CONTINUE_READING_ACCESSIBILE_NAME, accessible_name);
}
suggestion_chip_view_->SetAccessibleName(accessible_name);
}
} // namespace app_list
......@@ -162,11 +162,6 @@ void SuggestionChipView::OnBlur() {
SchedulePaint();
}
void SuggestionChipView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
node_data->role = ax::mojom::Role::kButton;
node_data->SetName(GetText());
}
std::unique_ptr<views::InkDrop> SuggestionChipView::CreateInkDrop() {
std::unique_ptr<views::InkDropImpl> ink_drop =
Button::CreateDefaultInkDropImpl();
......
......@@ -49,7 +49,6 @@ class APP_LIST_EXPORT SuggestionChipView : public views::Button {
void OnPaintBackground(gfx::Canvas* canvas) override;
void OnFocus() override;
void OnBlur() override;
void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
// views::InkDropHost:
std::unique_ptr<views::InkDrop> CreateInkDrop() override;
......
......@@ -803,6 +803,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_LIST_CONTINUE_READING_ACCESSIBILE_NAME" desc="The spoken feedback text for the suggestion chip of continue reading.">
Continue reading from your mobile device <ph name="title">$1<ex>Title</ex></ph>
</message>
<message name="IDS_APP_ACCESSIBILITY_STAR_RATING_ARC" desc="Accessibility text for the star rating of a Play Store app.">
Star rating <ph name="RATING_SCORE">$1<ex>5.0</ex></ph>
</message>
......
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