| 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 return this.dataItem; | 240 return this.dataItem; |
| 241 }, | 241 }, |
| 242 set url(url) { | 242 set url(url) { |
| 243 this.dataItem = url; | 243 this.dataItem = url; |
| 244 }, | 244 }, |
| 245 }; | 245 }; |
| 246 | 246 |
| 247 /** | 247 /** |
| 248 * Create a new passwords list. | 248 * Create a new passwords list. |
| 249 * @constructor | 249 * @constructor |
| 250 * @extends {cr.ui.List} | 250 * @extends {options.DeletableItemList} |
| 251 */ | 251 */ |
| 252 var PasswordsList = cr.ui.define('list'); | 252 var PasswordsList = cr.ui.define('list'); |
| 253 | 253 |
| 254 PasswordsList.prototype = { | 254 PasswordsList.prototype = { |
| 255 __proto__: DeletableItemList.prototype, | 255 __proto__: DeletableItemList.prototype, |
| 256 | 256 |
| 257 /** | 257 /** |
| 258 * Whether passwords can be revealed or not. | 258 * Whether passwords can be revealed or not. |
| 259 * @type {boolean} | 259 * @type {boolean} |
| 260 * @private | 260 * @private |
| (...skipping 11 matching lines...) Expand all Loading... |
| 272 /** | 272 /** |
| 273 * Listener for changes on the preference. | 273 * Listener for changes on the preference. |
| 274 * @param {Event} event The preference update event. | 274 * @param {Event} event The preference update event. |
| 275 * @private | 275 * @private |
| 276 */ | 276 */ |
| 277 onPreferenceChanged_: function(event) { | 277 onPreferenceChanged_: function(event) { |
| 278 this.showPasswords_ = event.value.value; | 278 this.showPasswords_ = event.value.value; |
| 279 this.redraw(); | 279 this.redraw(); |
| 280 }, | 280 }, |
| 281 | 281 |
| 282 /** @override */ | 282 /** |
| 283 * @override |
| 284 * @param {Array} entry |
| 285 */ |
| 283 createItem: function(entry) { | 286 createItem: function(entry) { |
| 284 var showPasswords = this.showPasswords_; | 287 var showPasswords = this.showPasswords_; |
| 285 | 288 |
| 286 if (loadTimeData.getBoolean('disableShowPasswords')) | 289 if (loadTimeData.getBoolean('disableShowPasswords')) |
| 287 showPasswords = false; | 290 showPasswords = false; |
| 288 | 291 |
| 289 return new PasswordListItem(this.dataModel, entry, showPasswords); | 292 return new PasswordListItem(this.dataModel, entry, showPasswords); |
| 290 }, | 293 }, |
| 291 | 294 |
| 292 /** @override */ | 295 /** @override */ |
| (...skipping 17 matching lines...) Expand all Loading... |
| 310 /** | 313 /** |
| 311 * Create a new passwords list. | 314 * Create a new passwords list. |
| 312 * @constructor | 315 * @constructor |
| 313 * @extends {cr.ui.List} | 316 * @extends {cr.ui.List} |
| 314 */ | 317 */ |
| 315 var PasswordExceptionsList = cr.ui.define('list'); | 318 var PasswordExceptionsList = cr.ui.define('list'); |
| 316 | 319 |
| 317 PasswordExceptionsList.prototype = { | 320 PasswordExceptionsList.prototype = { |
| 318 __proto__: DeletableItemList.prototype, | 321 __proto__: DeletableItemList.prototype, |
| 319 | 322 |
| 320 /** @override */ | 323 /** |
| 324 * @override |
| 325 * @param {Array} entry |
| 326 */ |
| 321 createItem: function(entry) { | 327 createItem: function(entry) { |
| 322 return new PasswordExceptionsListItem(entry); | 328 return new PasswordExceptionsListItem(entry); |
| 323 }, | 329 }, |
| 324 | 330 |
| 325 /** @override */ | 331 /** @override */ |
| 326 deleteItemAtIndex: function(index) { | 332 deleteItemAtIndex: function(index) { |
| 327 PasswordManager.removePasswordException(index); | 333 PasswordManager.removePasswordException(index); |
| 328 }, | 334 }, |
| 329 | 335 |
| 330 /** | 336 /** |
| 331 * The length of the list. | 337 * The length of the list. |
| 332 */ | 338 */ |
| 333 get length() { | 339 get length() { |
| 334 return this.dataModel.length; | 340 return this.dataModel.length; |
| 335 }, | 341 }, |
| 336 }; | 342 }; |
| 337 | 343 |
| 338 return { | 344 return { |
| 339 PasswordListItem: PasswordListItem, | 345 PasswordListItem: PasswordListItem, |
| 340 PasswordExceptionsListItem: PasswordExceptionsListItem, | 346 PasswordExceptionsListItem: PasswordExceptionsListItem, |
| 341 PasswordsList: PasswordsList, | 347 PasswordsList: PasswordsList, |
| 342 PasswordExceptionsList: PasswordExceptionsList, | 348 PasswordExceptionsList: PasswordExceptionsList, |
| 343 }; | 349 }; |
| 344 }); | 350 }); |
| OLD | NEW |