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.autofillOptions', function() { | 5 cr.define('options.autofillOptions', function() { |
6 /** @const */ var DeletableItem = options.DeletableItem; | 6 /** @const */ var DeletableItem = options.DeletableItem; |
7 /** @const */ var DeletableItemList = options.DeletableItemList; | 7 /** @const */ var DeletableItemList = options.DeletableItemList; |
8 /** @const */ var InlineEditableItem = options.InlineEditableItem; | 8 /** @const */ var InlineEditableItem = options.InlineEditableItem; |
9 /** @const */ var InlineEditableItemList = options.InlineEditableItemList; | 9 /** @const */ var InlineEditableItemList = options.InlineEditableItemList; |
10 | 10 |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 this.clearValue_(); | 228 this.clearValue_(); |
229 } | 229 } |
230 } | 230 } |
231 }, | 231 }, |
232 }; | 232 }; |
233 | 233 |
234 /** | 234 /** |
235 * Creates a new name value list item. | 235 * Creates a new name value list item. |
236 * @param {options.autofillOptions.AutofillNameValuesList} list The parent | 236 * @param {options.autofillOptions.AutofillNameValuesList} list The parent |
237 * list of this item. | 237 * list of this item. |
238 * @param {Array.<string>} entry An array of [first, middle, last] names. | 238 * @param {Array<string>} entry An array of [first, middle, last] names. |
239 * @constructor | 239 * @constructor |
240 * @extends {options.autofillOptions.ValuesListItem} | 240 * @extends {options.autofillOptions.ValuesListItem} |
241 */ | 241 */ |
242 function NameListItem(list, entry) { | 242 function NameListItem(list, entry) { |
243 var el = cr.doc.createElement('div'); | 243 var el = cr.doc.createElement('div'); |
244 el.list = list; | 244 el.list = list; |
245 el.first = entry ? entry[0] : ''; | 245 el.first = entry ? entry[0] : ''; |
246 el.middle = entry ? entry[1] : ''; | 246 el.middle = entry ? entry[1] : ''; |
247 el.last = entry ? entry[2] : ''; | 247 el.last = entry ? entry[2] : ''; |
248 el.__proto__ = NameListItem.prototype; | 248 el.__proto__ = NameListItem.prototype; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 * @constructor | 462 * @constructor |
463 * @extends {options.autofillOptions.AutofillValuesList} | 463 * @extends {options.autofillOptions.AutofillValuesList} |
464 */ | 464 */ |
465 var AutofillNameValuesList = cr.ui.define('list'); | 465 var AutofillNameValuesList = cr.ui.define('list'); |
466 | 466 |
467 AutofillNameValuesList.prototype = { | 467 AutofillNameValuesList.prototype = { |
468 __proto__: AutofillValuesList.prototype, | 468 __proto__: AutofillValuesList.prototype, |
469 | 469 |
470 /** | 470 /** |
471 * @override | 471 * @override |
472 * @param {Array.<string>} entry | 472 * @param {Array<string>} entry |
473 */ | 473 */ |
474 createItem: function(entry) { | 474 createItem: function(entry) { |
475 return new NameListItem(this, entry); | 475 return new NameListItem(this, entry); |
476 }, | 476 }, |
477 }; | 477 }; |
478 | 478 |
479 /** | 479 /** |
480 * Create a new value list for phone number validation. | 480 * Create a new value list for phone number validation. |
481 * @constructor | 481 * @constructor |
482 * @extends {options.autofillOptions.AutofillValuesList} | 482 * @extends {options.autofillOptions.AutofillValuesList} |
(...skipping 18 matching lines...) Expand all Loading... |
501 | 501 |
502 /** | 502 /** |
503 * The number of ongoing validation requests. | 503 * The number of ongoing validation requests. |
504 * @type {number} | 504 * @type {number} |
505 * @private | 505 * @private |
506 */ | 506 */ |
507 validationRequests_: 0, | 507 validationRequests_: 0, |
508 | 508 |
509 /** | 509 /** |
510 * Pending Promise resolver functions. | 510 * Pending Promise resolver functions. |
511 * @type {Array.<!Function>} | 511 * @type {Array<!Function>} |
512 * @private | 512 * @private |
513 */ | 513 */ |
514 validationPromiseResolvers_: [], | 514 validationPromiseResolvers_: [], |
515 | 515 |
516 /** | 516 /** |
517 * This should be called when a reply of chrome.send('validatePhoneNumbers') | 517 * This should be called when a reply of chrome.send('validatePhoneNumbers') |
518 * is received. | 518 * is received. |
519 */ | 519 */ |
520 didReceiveValidationResult: function() { | 520 didReceiveValidationResult: function() { |
521 this.validationRequests_--; | 521 this.validationRequests_--; |
(...skipping 25 matching lines...) Expand all Loading... |
547 CreditCardListItem: CreditCardListItem, | 547 CreditCardListItem: CreditCardListItem, |
548 ValuesListItem: ValuesListItem, | 548 ValuesListItem: ValuesListItem, |
549 NameListItem: NameListItem, | 549 NameListItem: NameListItem, |
550 AutofillAddressList: AutofillAddressList, | 550 AutofillAddressList: AutofillAddressList, |
551 AutofillCreditCardList: AutofillCreditCardList, | 551 AutofillCreditCardList: AutofillCreditCardList, |
552 AutofillValuesList: AutofillValuesList, | 552 AutofillValuesList: AutofillValuesList, |
553 AutofillNameValuesList: AutofillNameValuesList, | 553 AutofillNameValuesList: AutofillNameValuesList, |
554 AutofillPhoneValuesList: AutofillPhoneValuesList, | 554 AutofillPhoneValuesList: AutofillPhoneValuesList, |
555 }; | 555 }; |
556 }); | 556 }); |
OLD | NEW |