| 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 b286e8e610c04a97fc03e556f339755de64cb033..b15aace46c09d86ad3344a8296d39542536d6401 100644
|
| --- a/chrome/browser/resources/options/password_manager_list.js
|
| +++ b/chrome/browser/resources/options/password_manager_list.js
|
| @@ -14,10 +14,11 @@ cr.define('options.passwordManager', function() {
|
| * @constructor
|
| * @extends {cr.ui.ListItem}
|
| */
|
| - function PasswordListItem(entry) {
|
| + function PasswordListItem(entry, showPassword) {
|
| var el = cr.doc.createElement('div');
|
| el.dataItem = entry;
|
| el.__proto__ = PasswordListItem.prototype;
|
| + el.showPassword = showPassword;
|
| el.decorate();
|
|
|
| return el;
|
| @@ -57,18 +58,23 @@ cr.define('options.passwordManager', function() {
|
| passwordInputDiv.appendChild(passwordInput);
|
|
|
| // The show/hide button.
|
| - var button = this.ownerDocument.createElement('button');
|
| - button.classList.add('hidden');
|
| - button.classList.add('password-button');
|
| - button.textContent = localStrings.getString('passwordShowButton');
|
| - button.addEventListener('click', this.onClick_, true);
|
| - passwordInputDiv.appendChild(button);
|
| + if (this.showPassword) {
|
| + var button = this.ownerDocument.createElement('button');
|
| + button.classList.add('hidden');
|
| + button.classList.add('password-button');
|
| + button.textContent = localStrings.getString('passwordShowButton');
|
| + button.addEventListener('click', this.onClick_, true);
|
| + passwordInputDiv.appendChild(button);
|
| + }
|
|
|
| this.contentElement.appendChild(passwordInputDiv);
|
| },
|
|
|
| /** @inheritDoc */
|
| selectionChanged: function() {
|
| + if (!this.showPassword)
|
| + return;
|
| +
|
| var passwordInput = this.querySelector('input[type=password]');
|
| var textInput = this.querySelector('input[type=text]');
|
| var input = passwordInput || textInput;
|
| @@ -191,7 +197,7 @@ cr.define('options.passwordManager', function() {
|
|
|
| /** @inheritDoc */
|
| createItem: function(entry) {
|
| - return new PasswordListItem(entry);
|
| + return new PasswordListItem(entry, this.showPasswords);
|
| },
|
|
|
| /** @inheritDoc */
|
| @@ -205,6 +211,12 @@ cr.define('options.passwordManager', function() {
|
| get length() {
|
| return this.dataModel.length;
|
| },
|
| +
|
| + /**
|
| + * Whether passwords can be displayed in clear text or not.
|
| + * @type {boolean}
|
| + */
|
| + showPasswords: true,
|
| };
|
|
|
| /**
|
|
|