Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: chrome/browser/resources/md_bookmarks/toast_manager.js

Issue 2955563002: MD Bookmarks: Initial screenreader accessibility improvements (Closed)
Patch Set: Privatize and rebase Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/md_bookmarks/toast_manager.js
diff --git a/chrome/browser/resources/md_bookmarks/toast_manager.js b/chrome/browser/resources/md_bookmarks/toast_manager.js
index 642ce3828deb3e72d8052b014cbcaee892b180ab..3692b5f949b478d543d52c3a1a2bd2d1050e6ac3 100644
--- a/chrome/browser/resources/md_bookmarks/toast_manager.js
+++ b/chrome/browser/resources/md_bookmarks/toast_manager.js
@@ -19,7 +19,8 @@ cr.define('bookmarks', function() {
/** @private */
open_: {
type: Boolean,
- reflectToAttribute: true,
+ observer: 'openChanged_',
+ value: false,
},
/** @private */
@@ -36,6 +37,9 @@ cr.define('bookmarks', function() {
attached: function() {
assert(ToastManager.instance_ == null);
ToastManager.instance_ = this;
+ Polymer.RenderStatus.afterNextRender(this, function() {
+ Polymer.IronA11yAnnouncer.requestAvailability();
+ });
},
/** @override */
@@ -82,6 +86,7 @@ cr.define('bookmarks', function() {
showInternal_: function(showUndo) {
this.open_ = true;
this.showUndo_ = showUndo;
+ this.fire('iron-announce', {text: this.$.content.textContent});
if (!this.duration)
return;
@@ -90,13 +95,15 @@ cr.define('bookmarks', function() {
this.timerProxy_.clearTimeout(this.hideTimeoutId_);
this.hideTimeoutId_ = this.timerProxy_.setTimeout(function() {
- this.open_ = false;
+ this.hide();
this.hideTimeoutId_ = null;
}.bind(this), this.duration);
},
hide: function() {
this.open_ = false;
+ // Hide the undo button to prevent it from being accessed with tab.
+ this.showUndo_ = false;
},
/** @private */
@@ -104,6 +111,11 @@ cr.define('bookmarks', function() {
// Will hide the toast.
this.fire('command-undo');
},
+
+ /** @private */
+ openChanged_: function() {
+ this.$.toast.setAttribute('aria-hidden', String(!this.open_));
+ },
});
/** @private {?bookmarks.ToastManager} */
« no previous file with comments | « chrome/browser/resources/md_bookmarks/toast_manager.html ('k') | chrome/browser/resources/md_bookmarks/toolbar.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698