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

Unified Diff: chrome/browser/resources/chromeos/login/user_pod_row.js

Issue 8396032: Make user remove button focusable, and set up the correct tab order. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code Review Created 9 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
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/resources/chromeos/login/user_pod_template.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/login/user_pod_row.js
diff --git a/chrome/browser/resources/chromeos/login/user_pod_row.js b/chrome/browser/resources/chromeos/login/user_pod_row.js
index 8b9c2774a78c60ae01669abf86e078548ab3413f..4eb7dfaf8931871370e35215f89137142cbd6687 100644
--- a/chrome/browser/resources/chromeos/login/user_pod_row.js
+++ b/chrome/browser/resources/chromeos/login/user_pod_row.js
@@ -49,6 +49,8 @@ cr.define('login', function() {
this.activate.bind(this));
this.signinButtonElement.addEventListener('click',
this.activate.bind(this));
+ this.removeUserButtonElement.addEventListener('click',
+ this.handleRemoveButtonClick_.bind(this));
this.removeUserButtonElement.addEventListener('mouseout',
this.handleRemoveButtonMouseOut_.bind(this));
},
@@ -175,6 +177,9 @@ cr.define('login', function() {
this.imageElement.title = userDict.emailAddress;
this.enterButtonElement.hidden = true;
this.passwordElement.hidden = needSignin;
+ this.removeUserButtonElement.setAttribute(
+ 'aria-label', localStrings.getStringF('removeButtonAccessibleName',
+ userDict.emailAddress));
this.passwordElement.setAttribute('aria-label',
localStrings.getStringF(
'passwordFieldAccessibleName',
@@ -319,10 +324,7 @@ cr.define('login', function() {
if (!this.parentNode.rowEnabled)
return;
var handled = false;
- if (e.target == this.removeUserButtonElement) {
- this.handleRemoveButtonClick_(e);
- handled = true;
- } else if (!this.signinButtonElement.hidden) {
+ if (!this.signinButtonElement.hidden) {
this.parentNode.showSigninUI(this.user.emailAddress);
handled = true;
}
@@ -403,6 +405,8 @@ cr.define('login', function() {
this.appendChild(userPod);
userPod.initialize();
+ var index = this.findIndex_(userPod);
+ userPod.removeUserButtonElement.tabIndex = 100 + index;
},
/**
@@ -470,6 +474,7 @@ cr.define('login', function() {
// Popoulate the pod row.
for (var i = 0; i < users.length; ++i) {
this.addUserPod(users[i], animated);
+ this.pods[i].tabIndex = i + 1;
dmazzoni 2011/10/26 16:14:49 I'm pretty sure everything in the page with the sa
}
},
@@ -482,18 +487,21 @@ cr.define('login', function() {
return;
if (pod) {
+ var focusedTabIndex = 0;
for (var i = 0; i < this.pods.length; ++i) {
this.pods[i].activeRemoveButton = false;
if (this.pods[i] == pod) {
pod.classList.remove("faded");
pod.classList.add("focused");
pod.tabIndex = -1; // Make it not keyboard focusable.
+ focusedTabIndex = i + 1;
} else {
this.pods[i].classList.remove('focused');
this.pods[i].classList.add('faded');
- this.pods[i].tabIndex = 0;
+ this.pods[i].tabIndex = i + 1;
}
}
+ pod.mainInput.tabIndex = focusedTabIndex;
pod.focusInput();
this.focusedPod_ = pod;
@@ -503,7 +511,7 @@ cr.define('login', function() {
this.pods[i].classList.remove('focused');
this.pods[i].classList.remove('faded');
this.pods[i].activeRemoveButton = false;
- this.pods[i].tabIndex = 0;
+ this.pods[i].tabIndex = i + 1;
}
this.focusedPod_ = undefined;
}
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/resources/chromeos/login/user_pod_template.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698