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 |
11 /** | 11 /** |
12 * Creates a new passwords list item. | 12 * Creates a new passwords list item. |
13 * @param {ArrayDataModel} dataModel The data model that contains this item. | 13 * @param {cr.ui.ArrayDataModel} dataModel The data model that contains this |
| 14 * item. |
14 * @param {Array} entry An array of the form [url, username, password]. When | 15 * @param {Array} entry An array of the form [url, username, password]. When |
15 * the list has been filtered, a fourth element [index] may be present. | 16 * the list has been filtered, a fourth element [index] may be present. |
16 * @param {boolean} showPasswords If true, add a button to the element to | 17 * @param {boolean} showPasswords If true, add a button to the element to |
17 * allow the user to reveal the saved password. | 18 * allow the user to reveal the saved password. |
18 * @constructor | 19 * @constructor |
19 * @extends {cr.ui.ListItem} | 20 * @extends {cr.ui.ListItem} |
20 */ | 21 */ |
21 function PasswordListItem(dataModel, entry, showPasswords) { | 22 function PasswordListItem(dataModel, entry, showPasswords) { |
22 var el = cr.doc.createElement('div'); | 23 var el = cr.doc.createElement('div'); |
23 el.dataItem = entry; | 24 el.dataItem = entry; |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 }, | 188 }, |
188 set password(password) { | 189 set password(password) { |
189 this.dataItem[2] = password; | 190 this.dataItem[2] = password; |
190 }, | 191 }, |
191 }; | 192 }; |
192 | 193 |
193 /** | 194 /** |
194 * Creates a new PasswordExceptions list item. | 195 * Creates a new PasswordExceptions list item. |
195 * @param {Array} entry A pair of the form [url, username]. | 196 * @param {Array} entry A pair of the form [url, username]. |
196 * @constructor | 197 * @constructor |
197 * @extends {Deletable.ListItem} | 198 * @extends {options.DeletableListItem} |
198 */ | 199 */ |
199 function PasswordExceptionsListItem(entry) { | 200 function PasswordExceptionsListItem(entry) { |
200 var el = cr.doc.createElement('div'); | 201 var el = cr.doc.createElement('div'); |
201 el.dataItem = entry; | 202 el.dataItem = entry; |
202 el.__proto__ = PasswordExceptionsListItem.prototype; | 203 el.__proto__ = PasswordExceptionsListItem.prototype; |
203 el.decorate(); | 204 el.decorate(); |
204 | 205 |
205 return el; | 206 return el; |
206 } | 207 } |
207 | 208 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 }, | 335 }, |
335 }; | 336 }; |
336 | 337 |
337 return { | 338 return { |
338 PasswordListItem: PasswordListItem, | 339 PasswordListItem: PasswordListItem, |
339 PasswordExceptionsListItem: PasswordExceptionsListItem, | 340 PasswordExceptionsListItem: PasswordExceptionsListItem, |
340 PasswordsList: PasswordsList, | 341 PasswordsList: PasswordsList, |
341 PasswordExceptionsList: PasswordExceptionsList, | 342 PasswordExceptionsList: PasswordExceptionsList, |
342 }; | 343 }; |
343 }); | 344 }); |
OLD | NEW |