| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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', function() { | 5 cr.define('options', function() { |
| 6 const OptionsPage = options.OptionsPage; | 6 const OptionsPage = options.OptionsPage; |
| 7 const ArrayDataModel = cr.ui.ArrayDataModel; | 7 const ArrayDataModel = cr.ui.ArrayDataModel; |
| 8 const ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; | |
| 9 | 8 |
| 10 ///////////////////////////////////////////////////////////////////////////// | 9 ///////////////////////////////////////////////////////////////////////////// |
| 11 // AutoFillOptions class: | 10 // AutoFillOptions class: |
| 12 | 11 |
| 13 /** | 12 /** |
| 14 * Encapsulated handling of AutoFill options page. | 13 * Encapsulated handling of AutoFill options page. |
| 15 * @constructor | 14 * @constructor |
| 16 */ | 15 */ |
| 17 function AutoFillOptions() { | 16 function AutoFillOptions() { |
| 18 OptionsPage.call(this, | 17 OptionsPage.call(this, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // AutoFill options page? | 57 // AutoFill options page? |
| 59 }, | 58 }, |
| 60 | 59 |
| 61 /** | 60 /** |
| 62 * Creates, decorates and initializes the address list. | 61 * Creates, decorates and initializes the address list. |
| 63 * @private | 62 * @private |
| 64 */ | 63 */ |
| 65 createAddressList_: function() { | 64 createAddressList_: function() { |
| 66 this.addressList_ = $('address-list'); | 65 this.addressList_ = $('address-list'); |
| 67 options.autoFillOptions.AutoFillAddressList.decorate(this.addressList_); | 66 options.autoFillOptions.AutoFillAddressList.decorate(this.addressList_); |
| 68 this.addressList_.selectionModel = new ListSingleSelectionModel; | |
| 69 this.addressList_.autoExpands = true; | 67 this.addressList_.autoExpands = true; |
| 70 }, | 68 }, |
| 71 | 69 |
| 72 /** | 70 /** |
| 73 * Creates, decorates and initializes the credit card list. | 71 * Creates, decorates and initializes the credit card list. |
| 74 * @private | 72 * @private |
| 75 */ | 73 */ |
| 76 createCreditCardList_: function() { | 74 createCreditCardList_: function() { |
| 77 this.creditCardList_ = $('creditcard-list'); | 75 this.creditCardList_ = $('creditcard-list'); |
| 78 options.autoFillOptions.AutoFillCreditCardList.decorate( | 76 options.autoFillOptions.AutoFillCreditCardList.decorate( |
| 79 this.creditCardList_); | 77 this.creditCardList_); |
| 80 this.creditCardList_.selectionModel = new ListSingleSelectionModel; | |
| 81 this.creditCardList_.autoExpands = true; | 78 this.creditCardList_.autoExpands = true; |
| 82 }, | 79 }, |
| 83 | 80 |
| 84 /** | 81 /** |
| 85 * Shows the 'Add address' overlay, specifically by loading the | 82 * Shows the 'Add address' overlay, specifically by loading the |
| 86 * 'Edit address' overlay, emptying the input fields and modifying the | 83 * 'Edit address' overlay, emptying the input fields and modifying the |
| 87 * overlay title. | 84 * overlay title. |
| 88 * @private | 85 * @private |
| 89 */ | 86 */ |
| 90 showAddAddressOverlay_: function() { | 87 showAddAddressOverlay_: function() { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 AutoFillOptions.getInstance().showEditCreditCardOverlay_(creditCard); | 221 AutoFillOptions.getInstance().showEditCreditCardOverlay_(creditCard); |
| 225 }; | 222 }; |
| 226 | 223 |
| 227 // Export | 224 // Export |
| 228 return { | 225 return { |
| 229 AutoFillOptions: AutoFillOptions | 226 AutoFillOptions: AutoFillOptions |
| 230 }; | 227 }; |
| 231 | 228 |
| 232 }); | 229 }); |
| 233 | 230 |
| OLD | NEW |