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

Unified Diff: chrome/browser/resources/options/password_manager_list.js

Issue 1477133002: Enables opening an origin from password exceptions list ("Never save" list) with keyboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/password_manager_list.js
diff --git a/chrome/browser/resources/options/password_manager_list.js b/chrome/browser/resources/options/password_manager_list.js
index b6c869aae48ff4e50deca29d4ae269fa8d769fcd..65a388ca65b70129661aca9fb68f933f7b9462a1 100644
--- a/chrome/browser/resources/options/password_manager_list.js
+++ b/chrome/browser/resources/options/password_manager_list.js
@@ -77,6 +77,9 @@ cr.define('options.passwordManager', function() {
urlLink.href = this.url;
urlLink.setAttribute('target', '_blank');
urlLink.textContent = this.shownUrl.split('').reverse().join('');
+ urlLink.addEventListener('focus', function() {
+ this.handleFocus();
+ }.bind(this));
urlDiv.appendChild(urlLink);
urlDiv.style.backgroundImage = getFaviconImageSet(
'origin/' + this.url, 16);
@@ -93,6 +96,9 @@ cr.define('options.passwordManager', function() {
usernameInput.className = 'inactive-item';
usernameInput.readOnly = true;
usernameInput.value = this.username;
+ usernameInput.addEventListener('focus', function() {
+ this.handleFocus();
+ }.bind(this));
usernameDiv.appendChild(usernameInput);
this.usernameField = usernameInput;
@@ -114,10 +120,9 @@ cr.define('options.passwordManager', function() {
passwordInput.readOnly = true;
passwordInput.value = this.showPasswords_ ? this.password : '********';
passwordInputDiv.appendChild(passwordInput);
- var deletableItem = this;
passwordInput.addEventListener('focus', function() {
- deletableItem.handleFocus();
- });
+ this.handleFocus();
+ }.bind(this));
this.passwordField = passwordInput;
this.setFocusable_(false);
@@ -135,8 +140,8 @@ cr.define('options.passwordManager', function() {
event.stopPropagation();
}, false);
button.addEventListener('focus', function() {
- deletableItem.handleFocus();
- });
+ this.handleFocus();
+ }.bind(this));
passwordInputDiv.appendChild(button);
this.passwordShowButton = button;
}
@@ -329,13 +334,37 @@ cr.define('options.passwordManager', function() {
urlLink.href = this.url;
urlLink.textContent = this.shownUrl.split('').reverse().join('');
urlLink.setAttribute('target', '_blank');
+ urlLink.addEventListener('focus', function() {
+ this.handleFocus();
+ }.bind(this));
+ this.urlLink = urlLink;
urlDiv.appendChild(urlLink);
urlDiv.style.backgroundImage = getFaviconImageSet(
'origin/' + this.url, 16);
- urlLink.tabIndex = -1;
this.contentElement.appendChild(urlDiv);
},
+ /** @override */
+ selectionChanged: function() {
+ if (this.selected) {
+ this.setFocusable_(true);
+ this.urlLink.focus();
+ } else {
+ this.setFocusable_(false);
+ }
+ },
+
+ /**
+ * Set the focusability of this row.
+ * @param {boolean} focusable
+ * @private
+ */
+ setFocusable_: function(focusable) {
+ var tabIndex = focusable ? 0 : -1;
+ this.urlLink.tabIndex = tabIndex;
+ this.closeButtonElement.tabIndex = tabIndex;
+ },
+
/**
* Get the url for the entry.
* @type {string}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698