Commit 9cb8e2ec authored by kolos's avatar kolos Committed by Commit bot

Enables opening an origin from password exceptions list ("Never save" list) with keyboard.

BUG=560769

Review URL: https://codereview.chromium.org/1477133002

Cr-Commit-Position: refs/heads/master@{#362936}
parent be147883
...@@ -77,6 +77,9 @@ cr.define('options.passwordManager', function() { ...@@ -77,6 +77,9 @@ cr.define('options.passwordManager', function() {
urlLink.href = this.url; urlLink.href = this.url;
urlLink.setAttribute('target', '_blank'); urlLink.setAttribute('target', '_blank');
urlLink.textContent = this.shownUrl.split('').reverse().join(''); urlLink.textContent = this.shownUrl.split('').reverse().join('');
urlLink.addEventListener('focus', function() {
this.handleFocus();
}.bind(this));
urlDiv.appendChild(urlLink); urlDiv.appendChild(urlLink);
urlDiv.style.backgroundImage = getFaviconImageSet( urlDiv.style.backgroundImage = getFaviconImageSet(
'origin/' + this.url, 16); 'origin/' + this.url, 16);
...@@ -93,6 +96,9 @@ cr.define('options.passwordManager', function() { ...@@ -93,6 +96,9 @@ cr.define('options.passwordManager', function() {
usernameInput.className = 'inactive-item'; usernameInput.className = 'inactive-item';
usernameInput.readOnly = true; usernameInput.readOnly = true;
usernameInput.value = this.username; usernameInput.value = this.username;
usernameInput.addEventListener('focus', function() {
this.handleFocus();
}.bind(this));
usernameDiv.appendChild(usernameInput); usernameDiv.appendChild(usernameInput);
this.usernameField = usernameInput; this.usernameField = usernameInput;
...@@ -114,10 +120,9 @@ cr.define('options.passwordManager', function() { ...@@ -114,10 +120,9 @@ cr.define('options.passwordManager', function() {
passwordInput.readOnly = true; passwordInput.readOnly = true;
passwordInput.value = this.showPasswords_ ? this.password : '********'; passwordInput.value = this.showPasswords_ ? this.password : '********';
passwordInputDiv.appendChild(passwordInput); passwordInputDiv.appendChild(passwordInput);
var deletableItem = this;
passwordInput.addEventListener('focus', function() { passwordInput.addEventListener('focus', function() {
deletableItem.handleFocus(); this.handleFocus();
}); }.bind(this));
this.passwordField = passwordInput; this.passwordField = passwordInput;
this.setFocusable_(false); this.setFocusable_(false);
...@@ -135,8 +140,8 @@ cr.define('options.passwordManager', function() { ...@@ -135,8 +140,8 @@ cr.define('options.passwordManager', function() {
event.stopPropagation(); event.stopPropagation();
}, false); }, false);
button.addEventListener('focus', function() { button.addEventListener('focus', function() {
deletableItem.handleFocus(); this.handleFocus();
}); }.bind(this));
passwordInputDiv.appendChild(button); passwordInputDiv.appendChild(button);
this.passwordShowButton = button; this.passwordShowButton = button;
} }
...@@ -329,13 +334,37 @@ cr.define('options.passwordManager', function() { ...@@ -329,13 +334,37 @@ cr.define('options.passwordManager', function() {
urlLink.href = this.url; urlLink.href = this.url;
urlLink.textContent = this.shownUrl.split('').reverse().join(''); urlLink.textContent = this.shownUrl.split('').reverse().join('');
urlLink.setAttribute('target', '_blank'); urlLink.setAttribute('target', '_blank');
urlLink.addEventListener('focus', function() {
this.handleFocus();
}.bind(this));
this.urlLink = urlLink;
urlDiv.appendChild(urlLink); urlDiv.appendChild(urlLink);
urlDiv.style.backgroundImage = getFaviconImageSet( urlDiv.style.backgroundImage = getFaviconImageSet(
'origin/' + this.url, 16); 'origin/' + this.url, 16);
urlLink.tabIndex = -1;
this.contentElement.appendChild(urlDiv); 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. * Get the url for the entry.
* @type {string} * @type {string}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment