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 /** @const */ var OptionsPage = options.OptionsPage; | 6 /** @const */ var OptionsPage = options.OptionsPage; |
7 | 7 |
8 /** | 8 /** |
9 * AutofillEditCreditCardOverlay class | 9 * AutofillEditCreditCardOverlay class |
10 * Encapsulated handling of the 'Add Page' overlay page. | 10 * Encapsulated handling of the 'Add Page' overlay page. |
11 * @class | 11 * @class |
12 */ | 12 */ |
13 function AutofillEditCreditCardOverlay() { | 13 function AutofillEditCreditCardOverlay() { |
14 OptionsPage.call(this, 'autofillEditCreditCard', | 14 OptionsPage.call(this, 'autofillEditCreditCard', |
15 loadTimeData.getString('autofillEditCreditCardTitle'), | 15 loadTimeData.getString('autofillEditCreditCardTitle'), |
16 'autofill-edit-credit-card-overlay'); | 16 'autofill-edit-credit-card-overlay'); |
17 } | 17 } |
18 | 18 |
19 cr.addSingletonGetter(AutofillEditCreditCardOverlay); | 19 cr.addSingletonGetter(AutofillEditCreditCardOverlay); |
20 | 20 |
21 AutofillEditCreditCardOverlay.prototype = { | 21 AutofillEditCreditCardOverlay.prototype = { |
22 __proto__: OptionsPage.prototype, | 22 __proto__: OptionsPage.prototype, |
23 | 23 |
24 /** | 24 /** @override */ |
25 * Initializes the page. | |
26 */ | |
27 initializePage: function() { | 25 initializePage: function() { |
28 OptionsPage.prototype.initializePage.call(this); | 26 OptionsPage.prototype.initializePage.call(this); |
29 | 27 |
30 var self = this; | 28 var self = this; |
31 $('autofill-edit-credit-card-cancel-button').onclick = function(event) { | 29 $('autofill-edit-credit-card-cancel-button').onclick = function(event) { |
32 self.dismissOverlay_(); | 30 self.dismissOverlay_(); |
33 }; | 31 }; |
34 $('autofill-edit-credit-card-apply-button').onclick = function(event) { | 32 $('autofill-edit-credit-card-apply-button').onclick = function(event) { |
35 self.saveCreditCard_(); | 33 self.saveCreditCard_(); |
36 self.dismissOverlay_(); | 34 self.dismissOverlay_(); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 195 |
198 AutofillEditCreditCardOverlay.setTitle = function(title) { | 196 AutofillEditCreditCardOverlay.setTitle = function(title) { |
199 $('autofill-credit-card-title').textContent = title; | 197 $('autofill-credit-card-title').textContent = title; |
200 }; | 198 }; |
201 | 199 |
202 // Export | 200 // Export |
203 return { | 201 return { |
204 AutofillEditCreditCardOverlay: AutofillEditCreditCardOverlay | 202 AutofillEditCreditCardOverlay: AutofillEditCreditCardOverlay |
205 }; | 203 }; |
206 }); | 204 }); |
OLD | NEW |