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 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 | 7 |
8 // The offset of the first profile in either the address list or the credit | 8 // The offset of the first profile in either the address list or the credit |
9 // card list. Consists of the header and the horizontal rule. | 9 // card list. Consists of the header and the horizontal rule. |
10 const profileOffset = 2; | 10 const profileOffset = 2; |
(...skipping 21 matching lines...) Expand all Loading... |
32 AutoFillOptions.prototype = { | 32 AutoFillOptions.prototype = { |
33 __proto__: OptionsPage.prototype, | 33 __proto__: OptionsPage.prototype, |
34 | 34 |
35 initializePage: function() { | 35 initializePage: function() { |
36 OptionsPage.prototype.initializePage.call(this); | 36 OptionsPage.prototype.initializePage.call(this); |
37 | 37 |
38 var self = this; | 38 var self = this; |
39 $('profileList').onchange = function(event) { | 39 $('profileList').onchange = function(event) { |
40 self.updateRemoveButtonState_(); | 40 self.updateRemoveButtonState_(); |
41 }; | 41 }; |
| 42 $('addAddressButton').onclick = function(event) { |
| 43 OptionsPage.showOverlay('autoFillEditAddressOverlay'); |
| 44 }; |
42 | 45 |
43 Preferences.getInstance().addEventListener('autofill.enabled', | 46 Preferences.getInstance().addEventListener('autofill.enabled', |
44 cr.bind(self.updateButtonState_, self)); | 47 cr.bind(self.updateButtonState_, self)); |
45 }, | 48 }, |
46 | 49 |
47 /** | 50 /** |
48 * Sets the enabled state of the button controls based on the current state | 51 * Sets the enabled state of the button controls based on the current state |
49 * of the |autoFillEnabled| checkbox. | 52 * of the |autoFillEnabled| checkbox. |
50 * @private | 53 * @private |
51 */ | 54 */ |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 AutoFillOptions.getInstance().updateCreditCards_(creditCards); | 139 AutoFillOptions.getInstance().updateCreditCards_(creditCards); |
137 }; | 140 }; |
138 | 141 |
139 // Export | 142 // Export |
140 return { | 143 return { |
141 AutoFillOptions: AutoFillOptions | 144 AutoFillOptions: AutoFillOptions |
142 }; | 145 }; |
143 | 146 |
144 }); | 147 }); |
145 | 148 |
OLD | NEW |