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

Unified Diff: ui/login/account_picker/user_pod_row.js

Issue 668833003: Make Smart Lock user pod icons work well with ChromeVox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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: ui/login/account_picker/user_pod_row.js
diff --git a/ui/login/account_picker/user_pod_row.js b/ui/login/account_picker/user_pod_row.js
index 96d678fb986a76dc090137788220cff98947ccd0..dbac7f3deafd7ca5546ca69ac05587e41b7cf7d0 100644
--- a/ui/login/account_picker/user_pod_row.js
+++ b/ui/login/account_picker/user_pod_row.js
@@ -292,6 +292,14 @@ cr.define('login', function() {
},
/**
+ * Sets the ARIA label for the icon.
+ * @param {!string} ariaLabel
+ */
+ setAriaLabel: function(ariaLabel) {
+ this.iconElement.setAttribute('aria-label', ariaLabel);
+ },
+
+ /**
* Shows the icon.
*/
show: function() {
@@ -352,9 +360,6 @@ cr.define('login', function() {
}
this.hideTooltip_(true);
-
- if (this.tooltip_)
- this.iconElement.setAttribute('aria-lablel', this.tooltip_);
},
/**
@@ -496,7 +501,6 @@ cr.define('login', function() {
return;
$('bubble').hideForElement(this);
this.tooltipAutoshown_ = false;
- this.iconElement.removeAttribute('aria-label');
},
/**
@@ -2246,6 +2250,7 @@ cr.define('login', function() {
* @param {string} username Username of pod to add button
* @param {!{id: !string,
* hardlockOnClick: boolean,
+ * ariaLabel: string | undefined,
* tooltip: ({text: string, autoshow: boolean} | undefined)}} icon
* The icon parameters.
*/
@@ -2269,6 +2274,12 @@ cr.define('login', function() {
pod.customIconElement.setInteractive(null);
}
+ var ariaLabel = icon.ariaLabel || (icon.tooltip && icon.tooltip.text);
+ if (ariaLabel)
+ pod.customIconElement.setAriaLabel(ariaLabel);
+ else
+ console.warn('No ARIA label for user pod custom icon.');
+
pod.customIconElement.show();
// This has to be called after |show| in case the tooltip should be shown
« chrome/app/generated_resources.grd ('K') | « chrome/browser/signin/screenlock_bridge.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698