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..ba255c610457a5d214d931d6b305752770ab436a 100644 |
--- a/chrome/browser/resources/options/password_manager_list.js |
+++ b/chrome/browser/resources/options/password_manager_list.js |
@@ -67,6 +67,7 @@ cr.define('options.passwordManager', function() { |
/** @override */ |
decorate: function() { |
DeletableItem.prototype.decorate.call(this); |
+ var deletableItem = this; |
// The URL of the site. |
var urlDiv = this.ownerDocument.createElement('div'); |
@@ -77,6 +78,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() { |
+ deletableItem.handleFocus(); |
Evan Stade
2015/11/30 18:23:36
urlLink.addEventListener('focus', function() {
t
kolos1
2015/12/01 09:00:13
Thanks. Done.
|
+ }); |
urlDiv.appendChild(urlLink); |
urlDiv.style.backgroundImage = getFaviconImageSet( |
'origin/' + this.url, 16); |
@@ -93,6 +97,9 @@ cr.define('options.passwordManager', function() { |
usernameInput.className = 'inactive-item'; |
usernameInput.readOnly = true; |
usernameInput.value = this.username; |
+ usernameInput.addEventListener('focus', function() { |
+ deletableItem.handleFocus(); |
+ }); |
usernameDiv.appendChild(usernameInput); |
this.usernameField = usernameInput; |
@@ -317,6 +324,7 @@ cr.define('options.passwordManager', function() { |
*/ |
decorate: function() { |
DeletableItem.prototype.decorate.call(this); |
+ var deletableItem = this; |
// The URL of the site. |
var urlDiv = this.ownerDocument.createElement('div'); |
@@ -329,13 +337,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() { |
+ deletableItem.handleFocus(); |
+ }); |
+ 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} |