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', function() { | 5 cr.define('options', function() { |
6 var Page = cr.ui.pageManager.Page; | 6 var Page = cr.ui.pageManager.Page; |
7 var PageManager = cr.ui.pageManager.PageManager; | 7 var PageManager = cr.ui.pageManager.PageManager; |
8 var ArrayDataModel = cr.ui.ArrayDataModel; | 8 var ArrayDataModel = cr.ui.ArrayDataModel; |
9 | 9 |
10 ///////////////////////////////////////////////////////////////////////////// | 10 ///////////////////////////////////////////////////////////////////////////// |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 /** | 98 /** |
99 * Shows the 'Add address' overlay, specifically by loading the | 99 * Shows the 'Add address' overlay, specifically by loading the |
100 * 'Edit address' overlay and modifying the overlay title. | 100 * 'Edit address' overlay and modifying the overlay title. |
101 * @private | 101 * @private |
102 */ | 102 */ |
103 showAddAddressOverlay_: function() { | 103 showAddAddressOverlay_: function() { |
104 var title = loadTimeData.getString('addAddressTitle'); | 104 var title = loadTimeData.getString('addAddressTitle'); |
105 AutofillEditAddressOverlay.setTitle(title); | 105 AutofillEditAddressOverlay.setTitle(title); |
106 PageManager.showPageByName('autofillEditAddress'); | 106 PageManager.showPageByName('autofillEditAddress'); |
| 107 AutofillEditAddressOverlay.prepForNewAddress(); |
107 }, | 108 }, |
108 | 109 |
109 /** | 110 /** |
110 * Shows the 'Add credit card' overlay, specifically by loading the | 111 * Shows the 'Add credit card' overlay, specifically by loading the |
111 * 'Edit credit card' overlay and modifying the overlay title. | 112 * 'Edit credit card' overlay and modifying the overlay title. |
112 * @private | 113 * @private |
113 */ | 114 */ |
114 showAddCreditCardOverlay_: function() { | 115 showAddCreditCardOverlay_: function() { |
115 var title = loadTimeData.getString('addCreditCardTitle'); | 116 var title = loadTimeData.getString('addCreditCardTitle'); |
116 AutofillEditCreditCardOverlay.setTitle(title); | 117 AutofillEditCreditCardOverlay.setTitle(title); |
117 PageManager.showPageByName('autofillEditCreditCard'); | 118 PageManager.showPageByName('autofillEditCreditCard'); |
| 119 AutofillEditCreditCardOverlay.prepForNewCard(); |
118 }, | 120 }, |
119 | 121 |
120 /** | 122 /** |
121 * Updates the data model for the address list with the values from | 123 * Updates the data model for the address list with the values from |
122 * |entries|. | 124 * |entries|. |
123 * @param {Array} entries The list of addresses. | 125 * @param {Array} entries The list of addresses. |
124 */ | 126 */ |
125 setAddressList_: function(entries) { | 127 setAddressList_: function(entries) { |
126 this.addressList_.dataModel = new ArrayDataModel(entries); | 128 this.addressList_.dataModel = new ArrayDataModel(entries); |
127 }, | 129 }, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 */ | 176 */ |
175 showEditAddressOverlay_: function(address) { | 177 showEditAddressOverlay_: function(address) { |
176 var title = loadTimeData.getString('editAddressTitle'); | 178 var title = loadTimeData.getString('editAddressTitle'); |
177 AutofillEditAddressOverlay.setTitle(title); | 179 AutofillEditAddressOverlay.setTitle(title); |
178 AutofillEditAddressOverlay.loadAddress(address); | 180 AutofillEditAddressOverlay.loadAddress(address); |
179 PageManager.showPageByName('autofillEditAddress'); | 181 PageManager.showPageByName('autofillEditAddress'); |
180 }, | 182 }, |
181 | 183 |
182 /** | 184 /** |
183 * Shows the 'Edit credit card' overlay, using the data in |credit_card| to | 185 * Shows the 'Edit credit card' overlay, using the data in |credit_card| to |
184 * fill the input fields. |address| is a list with one item, an associative | 186 * fill the input fields. |creditCard| is a list with one item, an |
185 * array that contains the credit card data. | 187 * associative array that contains the credit card data. |
186 * @private | 188 * @private |
187 */ | 189 */ |
188 showEditCreditCardOverlay_: function(creditCard) { | 190 showEditCreditCardOverlay_: function(creditCard) { |
189 var title = loadTimeData.getString('editCreditCardTitle'); | 191 var title = loadTimeData.getString('editCreditCardTitle'); |
190 AutofillEditCreditCardOverlay.setTitle(title); | 192 AutofillEditCreditCardOverlay.setTitle(title); |
191 AutofillEditCreditCardOverlay.loadCreditCard(creditCard); | 193 AutofillEditCreditCardOverlay.loadCreditCard(creditCard); |
192 PageManager.showPageByName('autofillEditCreditCard'); | 194 PageManager.showPageByName('autofillEditCreditCard'); |
193 }, | 195 }, |
194 }; | 196 }; |
195 | 197 |
(...skipping 25 matching lines...) Expand all Loading... |
221 AutofillOptions.getInstance().showEditCreditCardOverlay_(creditCard); | 223 AutofillOptions.getInstance().showEditCreditCardOverlay_(creditCard); |
222 }; | 224 }; |
223 | 225 |
224 // Export | 226 // Export |
225 return { | 227 return { |
226 AutofillOptions: AutofillOptions | 228 AutofillOptions: AutofillOptions |
227 }; | 229 }; |
228 | 230 |
229 }); | 231 }); |
230 | 232 |
OLD | NEW |