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 /** | 5 /** |
6 * @typedef {{ | 6 * @typedef {{ |
7 * guid: string, | 7 * guid: string, |
8 * label: string, | 8 * label: string, |
9 * sublabel: string, | 9 * sublabel: string, |
10 * isLocal: boolean, | 10 * isLocal: boolean, |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 // The 'Edit' button. | 92 // The 'Edit' button. |
93 var metadata = this.metadata_; | 93 var metadata = this.metadata_; |
94 var editButtonEl = AutofillEditProfileButton( | 94 var editButtonEl = AutofillEditProfileButton( |
95 AddressListItem.prototype.loadAddressEditor.bind(this)); | 95 AddressListItem.prototype.loadAddressEditor.bind(this)); |
96 this.contentElement.appendChild(editButtonEl); | 96 this.contentElement.appendChild(editButtonEl); |
97 }, | 97 }, |
98 | 98 |
99 /** | 99 /** |
100 * For local Autofill data, this function causes the AutofillOptionsHandler | 100 * For local Autofill data, this function causes the AutofillOptionsHandler |
101 * to call showEditAddressOverlay(). For Wallet data, the user is | 101 * to call showEditAddressOverlay(). For Payments data, the user is |
102 * redirected to the Wallet web interface. | 102 * redirected to the Payments web interface. |
103 */ | 103 */ |
104 loadAddressEditor: function() { | 104 loadAddressEditor: function() { |
105 if (this.metadata_.isLocal) | 105 if (this.metadata_.isLocal) |
106 chrome.send('loadAddressEditor', [this.metadata_.guid]); | 106 chrome.send('loadAddressEditor', [this.metadata_.guid]); |
107 else | 107 else |
108 window.open(loadTimeData.getString('manageWalletAddressesUrl')); | 108 window.open(loadTimeData.getString('paymentsManageAddressesUrl')); |
109 }, | 109 }, |
110 }; | 110 }; |
111 | 111 |
112 /** | 112 /** |
113 * Creates a new credit card list item. | 113 * Creates a new credit card list item. |
114 * @param {AutofillEntityMetadata} metadata Details about a credit card. | 114 * @param {AutofillEntityMetadata} metadata Details about a credit card. |
115 * @constructor | 115 * @constructor |
116 * @extends {options.DeletableItem} | 116 * @extends {options.DeletableItem} |
117 */ | 117 */ |
118 function CreditCardListItem(metadata) { | 118 function CreditCardListItem(metadata) { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 // The 'Edit' button. | 165 // The 'Edit' button. |
166 var metadata = this.metadata_; | 166 var metadata = this.metadata_; |
167 var editButtonEl = AutofillEditProfileButton( | 167 var editButtonEl = AutofillEditProfileButton( |
168 CreditCardListItem.prototype.loadCreditCardEditor.bind(this)); | 168 CreditCardListItem.prototype.loadCreditCardEditor.bind(this)); |
169 this.contentElement.appendChild(editButtonEl); | 169 this.contentElement.appendChild(editButtonEl); |
170 }, | 170 }, |
171 | 171 |
172 /** | 172 /** |
173 * For local Autofill data, this function causes the AutofillOptionsHandler | 173 * For local Autofill data, this function causes the AutofillOptionsHandler |
174 * to call showEditCreditCardOverlay(). For Wallet data, the user is | 174 * to call showEditCreditCardOverlay(). For Payments data, the user is |
175 * redirected to the Wallet web interface. | 175 * redirected to the Payments web interface. |
176 */ | 176 */ |
177 loadCreditCardEditor: function() { | 177 loadCreditCardEditor: function() { |
178 if (this.metadata_.isLocal) | 178 if (this.metadata_.isLocal) |
179 chrome.send('loadCreditCardEditor', [this.metadata_.guid]); | 179 chrome.send('loadCreditCardEditor', [this.metadata_.guid]); |
180 else | 180 else |
181 window.open(loadTimeData.getString('manageWalletPaymentMethodsUrl')); | 181 window.open(loadTimeData.getString('paymentsManageInstrumentsUrl')); |
182 }, | 182 }, |
183 }; | 183 }; |
184 | 184 |
185 /** | 185 /** |
186 * Base class for shared implementation between address and credit card lists. | 186 * Base class for shared implementation between address and credit card lists. |
187 * @constructor | 187 * @constructor |
188 * @extends {options.DeletableItemList} | 188 * @extends {options.DeletableItemList} |
189 */ | 189 */ |
190 var AutofillProfileList = cr.ui.define('list'); | 190 var AutofillProfileList = cr.ui.define('list'); |
191 | 191 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 }; | 276 }; |
277 | 277 |
278 return { | 278 return { |
279 AutofillProfileList: AutofillProfileList, | 279 AutofillProfileList: AutofillProfileList, |
280 AddressListItem: AddressListItem, | 280 AddressListItem: AddressListItem, |
281 CreditCardListItem: CreditCardListItem, | 281 CreditCardListItem: CreditCardListItem, |
282 AutofillAddressList: AutofillAddressList, | 282 AutofillAddressList: AutofillAddressList, |
283 AutofillCreditCardList: AutofillCreditCardList, | 283 AutofillCreditCardList: AutofillCreditCardList, |
284 }; | 284 }; |
285 }); | 285 }); |
OLD | NEW |