| 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 * @param {Event} event The preference update event. | 272 * @param {Event} event The preference update event. |
| 273 * @private | 273 * @private |
| 274 */ | 274 */ |
| 275 onPreferenceChanged_: function(event) { | 275 onPreferenceChanged_: function(event) { |
| 276 this.showPasswords_ = event.value.value; | 276 this.showPasswords_ = event.value.value; |
| 277 this.redraw(); | 277 this.redraw(); |
| 278 }, | 278 }, |
| 279 | 279 |
| 280 /** @override */ | 280 /** @override */ |
| 281 createItem: function(entry) { | 281 createItem: function(entry) { |
| 282 return new PasswordListItem(this.dataModel, entry, this.showPasswords_); | 282 var showPasswords = this.showPasswords_; |
| 283 |
| 284 if (loadTimeData.getBoolean('disableShowPasswords')) |
| 285 showPasswords = false; |
| 286 |
| 287 return new PasswordListItem(this.dataModel, entry, showPasswords); |
| 283 }, | 288 }, |
| 284 | 289 |
| 285 /** @override */ | 290 /** @override */ |
| 286 deleteItemAtIndex: function(index) { | 291 deleteItemAtIndex: function(index) { |
| 287 var item = this.dataModel.item(index); | 292 var item = this.dataModel.item(index); |
| 288 if (item && item.length > 3) { | 293 if (item && item.length > 3) { |
| 289 // The fourth element, if present, is the original index to delete. | 294 // The fourth element, if present, is the original index to delete. |
| 290 index = item[3]; | 295 index = item[3]; |
| 291 } | 296 } |
| 292 PasswordManager.removeSavedPassword(index); | 297 PasswordManager.removeSavedPassword(index); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 }, | 333 }, |
| 329 }; | 334 }; |
| 330 | 335 |
| 331 return { | 336 return { |
| 332 PasswordListItem: PasswordListItem, | 337 PasswordListItem: PasswordListItem, |
| 333 PasswordExceptionsListItem: PasswordExceptionsListItem, | 338 PasswordExceptionsListItem: PasswordExceptionsListItem, |
| 334 PasswordsList: PasswordsList, | 339 PasswordsList: PasswordsList, |
| 335 PasswordExceptionsList: PasswordExceptionsList, | 340 PasswordExceptionsList: PasswordExceptionsList, |
| 336 }; | 341 }; |
| 337 }); | 342 }); |
| OLD | NEW |