OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 /** | 5 /** |
6 * @fileoverview 'settings-autofill-section' is the section containing saved | 6 * @fileoverview 'settings-autofill-section' is the section containing saved |
7 * addresses and credit cards for use in autofill. | 7 * addresses and credit cards for use in autofill. |
8 */ | 8 */ |
9 | 9 |
10 /** | 10 /** |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 /** | 206 /** |
207 * @type {?function(!Array<!AutofillManager.CreditCardEntry>)} | 207 * @type {?function(!Array<!AutofillManager.CreditCardEntry>)} |
208 * @private | 208 * @private |
209 */ | 209 */ |
210 setCreditCardsListener_: null, | 210 setCreditCardsListener_: null, |
211 | 211 |
212 /** @override */ | 212 /** @override */ |
213 attached: function() { | 213 attached: function() { |
214 // Create listener functions. | 214 // Create listener functions. |
215 /** @type {function(!Array<!AutofillManager.AddressEntry>)} */ | 215 /** @type {function(!Array<!AutofillManager.AddressEntry>)} */ |
216 var setAddressesListener = function(list) { | 216 var setAddressesListener = list => { |
217 this.addresses = list; | 217 this.addresses = list; |
218 }.bind(this); | 218 }; |
219 | 219 |
220 /** @type {function(!Array<!AutofillManager.CreditCardEntry>)} */ | 220 /** @type {function(!Array<!AutofillManager.CreditCardEntry>)} */ |
221 var setCreditCardsListener = function(list) { | 221 var setCreditCardsListener = list => { |
222 this.creditCards = list; | 222 this.creditCards = list; |
223 }.bind(this); | 223 }; |
224 | 224 |
225 // Remember the bound reference in order to detach. | 225 // Remember the bound reference in order to detach. |
226 this.setAddressesListener_ = setAddressesListener; | 226 this.setAddressesListener_ = setAddressesListener; |
227 this.setCreditCardsListener_ = setCreditCardsListener; | 227 this.setCreditCardsListener_ = setCreditCardsListener; |
228 | 228 |
229 // Set the managers. These can be overridden by tests. | 229 // Set the managers. These can be overridden by tests. |
230 this.autofillManager_ = AutofillManagerImpl.getInstance(); | 230 this.autofillManager_ = AutofillManagerImpl.getInstance(); |
231 | 231 |
232 // Request initial data. | 232 // Request initial data. |
233 this.autofillManager_.getAddressList(setAddressesListener); | 233 this.autofillManager_.getAddressList(setAddressesListener); |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 /** | 455 /** |
456 * @private | 456 * @private |
457 * @param {boolean} toggleValue | 457 * @param {boolean} toggleValue |
458 * @return {string} | 458 * @return {string} |
459 */ | 459 */ |
460 getOnOffLabel_: function(toggleValue) { | 460 getOnOffLabel_: function(toggleValue) { |
461 return toggleValue ? this.i18n('toggleOn') : this.i18n('toggleOff'); | 461 return toggleValue ? this.i18n('toggleOn') : this.i18n('toggleOff'); |
462 } | 462 } |
463 }); | 463 }); |
464 })(); | 464 })(); |
OLD | NEW |