OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 8 |
9 ///////////////////////////////////////////////////////////////////////////// | 9 ///////////////////////////////////////////////////////////////////////////// |
10 // AutoFillOptions class: | 10 // AutoFillOptions class: |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 /** | 165 /** |
166 * Shows the 'Edit address' overlay, using the data in |address| to fill the | 166 * Shows the 'Edit address' overlay, using the data in |address| to fill the |
167 * input fields. |address| is a list with one item, an associative array | 167 * input fields. |address| is a list with one item, an associative array |
168 * that contains the address data. | 168 * that contains the address data. |
169 * @private | 169 * @private |
170 */ | 170 */ |
171 showEditAddressOverlay_: function(address) { | 171 showEditAddressOverlay_: function(address) { |
172 var title = localStrings.getString('editAddressTitle'); | 172 var title = localStrings.getString('editAddressTitle'); |
173 AutoFillEditAddressOverlay.setTitle(title); | 173 AutoFillEditAddressOverlay.setTitle(title); |
174 AutoFillEditAddressOverlay.loadAddress(address[0]); | 174 AutoFillEditAddressOverlay.loadAddress(address); |
175 OptionsPage.navigateToPage('autoFillEditAddressOverlay'); | 175 OptionsPage.navigateToPage('autoFillEditAddressOverlay'); |
176 }, | 176 }, |
177 | 177 |
178 /** | 178 /** |
179 * Shows the 'Edit credit card' overlay, using the data in |credit_card| to | 179 * Shows the 'Edit credit card' overlay, using the data in |credit_card| to |
180 * fill the input fields. |address| is a list with one item, an associative | 180 * fill the input fields. |address| is a list with one item, an associative |
181 * array that contains the credit card data. | 181 * array that contains the credit card data. |
182 * @private | 182 * @private |
183 */ | 183 */ |
184 showEditCreditCardOverlay_: function(creditCard) { | 184 showEditCreditCardOverlay_: function(creditCard) { |
185 var title = localStrings.getString('editCreditCardTitle'); | 185 var title = localStrings.getString('editCreditCardTitle'); |
186 AutoFillEditCreditCardOverlay.setTitle(title); | 186 AutoFillEditCreditCardOverlay.setTitle(title); |
187 AutoFillEditCreditCardOverlay.loadCreditCard(creditCard[0]); | 187 AutoFillEditCreditCardOverlay.loadCreditCard(creditCard); |
188 OptionsPage.navigateToPage('autoFillEditCreditCardOverlay'); | 188 OptionsPage.navigateToPage('autoFillEditCreditCardOverlay'); |
189 }, | 189 }, |
190 }; | 190 }; |
191 | 191 |
192 AutoFillOptions.setAddressList = function(entries) { | 192 AutoFillOptions.setAddressList = function(entries) { |
193 AutoFillOptions.getInstance().setAddressList_(entries); | 193 AutoFillOptions.getInstance().setAddressList_(entries); |
194 }; | 194 }; |
195 | 195 |
196 AutoFillOptions.setCreditCardList = function(entries) { | 196 AutoFillOptions.setCreditCardList = function(entries) { |
197 AutoFillOptions.getInstance().setCreditCardList_(entries); | 197 AutoFillOptions.getInstance().setCreditCardList_(entries); |
(...skipping 23 matching lines...) Expand all Loading... |
221 AutoFillOptions.getInstance().showEditCreditCardOverlay_(creditCard); | 221 AutoFillOptions.getInstance().showEditCreditCardOverlay_(creditCard); |
222 }; | 222 }; |
223 | 223 |
224 // Export | 224 // Export |
225 return { | 225 return { |
226 AutoFillOptions: AutoFillOptions | 226 AutoFillOptions: AutoFillOptions |
227 }; | 227 }; |
228 | 228 |
229 }); | 229 }); |
230 | 230 |
OLD | NEW |