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 505384cd7eb1eb836d5865d47cea627eb1f56734..58f4ef6ce1b5bea653a3aa156362a5bf7b6804a0 100644 |
--- a/chrome/browser/resources/options/password_manager_list.js |
+++ b/chrome/browser/resources/options/password_manager_list.js |
@@ -32,8 +32,7 @@ cr.define('options.passwordManager', function() { |
// The URL of the site. |
var urlLabel = this.ownerDocument.createElement('div'); |
- urlLabel.className = 'url'; |
- urlLabel.classList.add('favicon-cell'); |
+ urlLabel.className = 'favicon-cell url'; |
stuartmorgan
2011/01/21 00:05:05
Two classList.add lines instead?
James Hawkins
2011/01/21 00:34:51
Done.
|
urlLabel.textContent = this.url; |
urlLabel.style.backgroundImage = url('chrome://favicon/' + this.url); |
this.contentElement.appendChild(urlLabel); |
@@ -50,17 +49,18 @@ cr.define('options.passwordManager', function() { |
// The password input field. |
var passwordInput = this.ownerDocument.createElement('input'); |
+ passwordInput.type = 'password'; |
passwordInput.className = 'inactive-password'; |
passwordInput.readOnly = true; |
- passwordInput.type = 'password'; |
passwordInput.value = this.password; |
passwordInputDiv.appendChild(passwordInput); |
// The show/hide button. |
- var buttonSpan = this.ownerDocument.createElement('span'); |
- buttonSpan.className = 'hidden'; |
- buttonSpan.addEventListener('click', this.onClick_, true); |
- passwordInputDiv.appendChild(buttonSpan); |
+ var button = this.ownerDocument.createElement('button'); |
+ button.className = 'hidden password-button'; |
stuartmorgan
2011/01/21 00:05:05
Same
James Hawkins
2011/01/21 00:34:51
Done.
|
+ button.textContent = localStrings.getString('passwordShowButton'); |
+ button.addEventListener('click', this.onClick_, true); |
+ passwordInputDiv.appendChild(button); |
this.contentElement.appendChild(passwordInputDiv); |
}, |
@@ -70,13 +70,13 @@ cr.define('options.passwordManager', function() { |
var passwordInput = this.querySelector('input[type=password]'); |
var textInput = this.querySelector('input[type=text]'); |
var input = passwordInput || textInput; |
- var buttonSpan = input.nextSibling; |
+ var button = input.nextSibling; |
if (this.selected) { |
input.classList.remove('inactive-password'); |
- buttonSpan.classList.remove('hidden'); |
+ button.classList.remove('hidden'); |
} else { |
input.classList.add('inactive-password'); |
- buttonSpan.classList.add('hidden'); |
+ button.classList.add('hidden'); |
} |
}, |
@@ -86,11 +86,16 @@ cr.define('options.passwordManager', function() { |
* @private |
*/ |
onClick_: function(event) { |
- // The password is the input element previous to the button span. |
- var buttonSpan = event.currentTarget; |
- var passwordInput = buttonSpan.previousSibling; |
- var type = passwordInput.type; |
- passwordInput.type = type == 'password' ? 'text' : 'password'; |
+ // The password is the input element previous to the button. |
+ var button = event.currentTarget; |
+ var passwordInput = button.previousSibling; |
+ if (passwordInput.type == 'password') { |
+ passwordInput.type = 'text'; |
+ button.textContent = localStrings.getString('passwordHideButton'); |
+ } else { |
+ passwordInput.type = 'password'; |
+ button.textContent = localStrings.getString('passwordShowButton'); |
+ } |
}, |
/** |