Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Side by Side Diff: chrome/browser/resources/options/autofill_edit_creditcard_overlay.js

Issue 410293004: Split OptionsPage into Page and PageManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ugh just no Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 Page = cr.ui.pageManager.Page;
7 /** @const */ var PageManager = cr.ui.pageManager.PageManager;
7 8
8 /** 9 /**
9 * AutofillEditCreditCardOverlay class 10 * AutofillEditCreditCardOverlay class
10 * Encapsulated handling of the 'Add Page' overlay page. 11 * Encapsulated handling of the 'Add Page' overlay page.
11 * @class 12 * @class
12 */ 13 */
13 function AutofillEditCreditCardOverlay() { 14 function AutofillEditCreditCardOverlay() {
14 OptionsPage.call(this, 'autofillEditCreditCard', 15 Page.call(this, 'autofillEditCreditCard',
15 loadTimeData.getString('autofillEditCreditCardTitle'), 16 loadTimeData.getString('autofillEditCreditCardTitle'),
16 'autofill-edit-credit-card-overlay'); 17 'autofill-edit-credit-card-overlay');
17 } 18 }
18 19
19 cr.addSingletonGetter(AutofillEditCreditCardOverlay); 20 cr.addSingletonGetter(AutofillEditCreditCardOverlay);
20 21
21 AutofillEditCreditCardOverlay.prototype = { 22 AutofillEditCreditCardOverlay.prototype = {
22 __proto__: OptionsPage.prototype, 23 __proto__: Page.prototype,
23 24
24 /** @override */ 25 /** @override */
25 initializePage: function() { 26 initializePage: function() {
26 OptionsPage.prototype.initializePage.call(this); 27 Page.prototype.initializePage.call(this);
27 28
28 var self = this; 29 var self = this;
29 $('autofill-edit-credit-card-cancel-button').onclick = function(event) { 30 $('autofill-edit-credit-card-cancel-button').onclick = function(event) {
30 self.dismissOverlay_(); 31 self.dismissOverlay_();
31 }; 32 };
32 $('autofill-edit-credit-card-apply-button').onclick = function(event) { 33 $('autofill-edit-credit-card-apply-button').onclick = function(event) {
33 self.saveCreditCard_(); 34 self.saveCreditCard_();
34 self.dismissOverlay_(); 35 self.dismissOverlay_();
35 }; 36 };
36 37
(...skipping 13 matching lines...) Expand all
50 this.dismissOverlay_(); 51 this.dismissOverlay_();
51 }, 52 },
52 53
53 /** 54 /**
54 * Clears any uncommitted input, and dismisses the overlay. 55 * Clears any uncommitted input, and dismisses the overlay.
55 * @private 56 * @private
56 */ 57 */
57 dismissOverlay_: function() { 58 dismissOverlay_: function() {
58 this.clearInputFields_(); 59 this.clearInputFields_();
59 this.guid_ = ''; 60 this.guid_ = '';
60 OptionsPage.closeOverlay(); 61 PageManager.closeOverlay();
61 }, 62 },
62 63
63 /** 64 /**
64 * Aggregates the values in the input fields into an array and sends the 65 * Aggregates the values in the input fields into an array and sends the
65 * array to the Autofill handler. 66 * array to the Autofill handler.
66 * @private 67 * @private
67 */ 68 */
68 saveCreditCard_: function() { 69 saveCreditCard_: function() {
69 var creditCard = new Array(5); 70 var creditCard = new Array(5);
70 creditCard[0] = this.guid_; 71 creditCard[0] = this.guid_;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 196
196 AutofillEditCreditCardOverlay.setTitle = function(title) { 197 AutofillEditCreditCardOverlay.setTitle = function(title) {
197 $('autofill-credit-card-title').textContent = title; 198 $('autofill-credit-card-title').textContent = title;
198 }; 199 };
199 200
200 // Export 201 // Export
201 return { 202 return {
202 AutofillEditCreditCardOverlay: AutofillEditCreditCardOverlay 203 AutofillEditCreditCardOverlay: AutofillEditCreditCardOverlay
203 }; 204 };
204 }); 205 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698