| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 cr.define('options.passwordManager', function() { | 5 cr.define('options.passwordManager', function() { |
| 6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
| 7 /** @const */ var DeletableItemList = options.DeletableItemList; | 7 /** @const */ var DeletableItemList = options.DeletableItemList; |
| 8 /** @const */ var DeletableItem = options.DeletableItem; | 8 /** @const */ var DeletableItem = options.DeletableItem; |
| 9 /** @const */ var List = cr.ui.List; | 9 /** @const */ var List = cr.ui.List; |
| 10 | 10 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 passwordInput.className = 'inactive-password'; | 64 passwordInput.className = 'inactive-password'; |
| 65 passwordInput.readOnly = true; | 65 passwordInput.readOnly = true; |
| 66 passwordInput.value = showPasswords ? this.password : '********'; | 66 passwordInput.value = showPasswords ? this.password : '********'; |
| 67 passwordInputDiv.appendChild(passwordInput); | 67 passwordInputDiv.appendChild(passwordInput); |
| 68 | 68 |
| 69 // The show/hide button. | 69 // The show/hide button. |
| 70 if (showPasswords) { | 70 if (showPasswords) { |
| 71 var button = this.ownerDocument.createElement('button'); | 71 var button = this.ownerDocument.createElement('button'); |
| 72 button.hidden = true; | 72 button.hidden = true; |
| 73 button.className = 'list-inline-button custom-appearance'; | 73 button.className = 'list-inline-button custom-appearance'; |
| 74 button.textContent = localStrings.getString('passwordShowButton'); | 74 button.textContent = loadTimeData.getString('passwordShowButton'); |
| 75 button.addEventListener('click', this.onClick_, true); | 75 button.addEventListener('click', this.onClick_, true); |
| 76 passwordInputDiv.appendChild(button); | 76 passwordInputDiv.appendChild(button); |
| 77 } | 77 } |
| 78 | 78 |
| 79 this.contentElement.appendChild(passwordInputDiv); | 79 this.contentElement.appendChild(passwordInputDiv); |
| 80 }, | 80 }, |
| 81 | 81 |
| 82 /** @inheritDoc */ | 82 /** @inheritDoc */ |
| 83 selectionChanged: function() { | 83 selectionChanged: function() { |
| 84 var passwordInput = this.querySelector('input[type=password]'); | 84 var passwordInput = this.querySelector('input[type=password]'); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 101 * On-click event handler. Swaps the type of the input field from password | 101 * On-click event handler. Swaps the type of the input field from password |
| 102 * to text and back. | 102 * to text and back. |
| 103 * @private | 103 * @private |
| 104 */ | 104 */ |
| 105 onClick_: function(event) { | 105 onClick_: function(event) { |
| 106 // The password is the input element previous to the button. | 106 // The password is the input element previous to the button. |
| 107 var button = event.currentTarget; | 107 var button = event.currentTarget; |
| 108 var passwordInput = button.previousSibling; | 108 var passwordInput = button.previousSibling; |
| 109 if (passwordInput.type == 'password') { | 109 if (passwordInput.type == 'password') { |
| 110 passwordInput.type = 'text'; | 110 passwordInput.type = 'text'; |
| 111 button.textContent = localStrings.getString('passwordHideButton'); | 111 button.textContent = loadTimeData.getString('passwordHideButton'); |
| 112 } else { | 112 } else { |
| 113 passwordInput.type = 'password'; | 113 passwordInput.type = 'password'; |
| 114 button.textContent = localStrings.getString('passwordShowButton'); | 114 button.textContent = loadTimeData.getString('passwordShowButton'); |
| 115 } | 115 } |
| 116 }, | 116 }, |
| 117 | 117 |
| 118 /** | 118 /** |
| 119 * Get and set the URL for the entry. | 119 * Get and set the URL for the entry. |
| 120 * @type {string} | 120 * @type {string} |
| 121 */ | 121 */ |
| 122 get url() { | 122 get url() { |
| 123 return this.dataItem[0]; | 123 return this.dataItem[0]; |
| 124 }, | 124 }, |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 }, | 288 }, |
| 289 }; | 289 }; |
| 290 | 290 |
| 291 return { | 291 return { |
| 292 PasswordListItem: PasswordListItem, | 292 PasswordListItem: PasswordListItem, |
| 293 PasswordExceptionsListItem: PasswordExceptionsListItem, | 293 PasswordExceptionsListItem: PasswordExceptionsListItem, |
| 294 PasswordsList: PasswordsList, | 294 PasswordsList: PasswordsList, |
| 295 PasswordExceptionsList: PasswordExceptionsList, | 295 PasswordExceptionsList: PasswordExceptionsList, |
| 296 }; | 296 }; |
| 297 }); | 297 }); |
| OLD | NEW |