Commit b3bd97b6 authored by Wenzhao Zang's avatar Wenzhao Zang Committed by Commit Bot

cros: ChromeVox should announce "Wallpaper set successfully"

cvox.Api.speak may work but it requires goog.provide and goog.require.

Instead we could focus the checkmark and ChromeVox will announce its
aria-label.

This is a no-op for non-ChromeVox users.

Bug: 779449
Change-Id: I48de41156bb66e86d5e6051963f25be8355e12e0
Reviewed-on: https://chromium-review.googlesource.com/1187822
Commit-Queue: Wenzhao (Colin) Zang <wzang@chromium.org>
Reviewed-by: default avatarAlexander Alekseev <alemate@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585930}
parent 8e9edd10
......@@ -535,6 +535,10 @@ body.v2 {
top: 8px;
}
.v2 .image-picker [role=listitem][selected] .check:focus {
outline: none;
}
.v2 .image-picker::-webkit-scrollbar-thumb {
background: #888;
display: none;
......
......@@ -324,10 +324,15 @@ cr.define('wallpapers', function() {
__proto__: Grid.prototype,
/**
* The checkbox element.
* The checkbox element shown with the currently set wallpaper.
* @type {Object}
*/
checkmark_: undefined,
get checkmark() {
return this.checkmark_;
},
/**
* ID of spinner delay timer.
* @private
......@@ -354,6 +359,7 @@ cr.define('wallpapers', function() {
* wallpaperInfo The information of the wallpaper to be set active.
*/
activeItem_: undefined,
set activeItem(activeItem) {
if (this.activeItem_ != activeItem) {
this.activeItem_ = activeItem;
......@@ -603,6 +609,7 @@ cr.define('wallpapers', function() {
this.checkmark_.classList.add('check');
this.checkmark_.setAttribute(
'aria-label', loadTimeData.getString('setSuccessfullyMessage'));
this.checkmark_.tabIndex = 0;
this.dataModel = new ArrayDataModel([]);
this.thumbnailList_ = new ArrayDataModel([]);
this.useNewWallpaperPicker_ =
......
......@@ -1061,6 +1061,9 @@ WallpaperManager.prototype.onWallpaperChanged_ = function(
$('wallpaper-set-by-message').textContent = '';
$('wallpaper-grid').classList.remove('small');
if (this.useNewWallpaperPicker_)
this.wallpaperGrid_.checkmark.focus();
// Disables daily refresh if user selects a non-daily wallpaper.
if (activeItem && activeItem.source !== Constants.WallpaperSourceEnum.Daily)
this.disableDailyRefresh_();
......
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