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 | 5 |
6 cr.define('mobile', function() { | 6 cr.define('mobile', function() { |
7 | 7 |
8 function MobileSetup() { | 8 function MobileSetup() { |
9 } | 9 } |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 if (this.initialized_) { | 39 if (this.initialized_) { |
40 console.log('calling initialize() again?'); | 40 console.log('calling initialize() again?'); |
41 return; | 41 return; |
42 } | 42 } |
43 this.initialized_ = true; | 43 this.initialized_ = true; |
44 self = this; | 44 self = this; |
45 this.frameName_ = frame_name; | 45 this.frameName_ = frame_name; |
46 window.addEventListener('message', function(e) { | 46 window.addEventListener('message', function(e) { |
47 self.onMessageReceived_(e); | 47 self.onMessageReceived_(e); |
48 }); | 48 }); |
| 49 $('closeButton').addEventListener('click', function(e) { |
| 50 $('finalMessage').classList.add('hidden'); |
| 51 }); |
49 $(frame_name).addEventListener('load', function(e) { | 52 $(frame_name).addEventListener('load', function(e) { |
50 // Flip the visibility of the payment page only after the frame is | 53 // Flip the visibility of the payment page only after the frame is |
51 // fully loaded. | 54 // fully loaded. |
52 if (self.state_ == MobileSetup.PLAN_ACTIVATION_SHOWING_PAYMENT) { | 55 if (self.state_ == MobileSetup.PLAN_ACTIVATION_SHOWING_PAYMENT) { |
53 $('statusHeader').textContent = ''; | 56 $('statusHeader').textContent = ''; |
54 $('finalMessage').classList.add('hidden'); | 57 $('finalMessage').classList.add('hidden'); |
55 $('errorMessage').classList.add('hidden'); | 58 $('errorMessage').classList.add('hidden'); |
56 $('systemStatus').classList.add('hidden'); | 59 $('systemStatus').classList.add('hidden'); |
57 $('canvas').classList.add('hidden'); | 60 $('canvas').classList.add('hidden'); |
58 $('paymentForm').classList.remove('hidden'); | 61 $('paymentForm').classList.remove('hidden'); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 mobile.MobileSetup.getInstance().initialize('paymentForm'); | 217 mobile.MobileSetup.getInstance().initialize('paymentForm'); |
215 }; | 218 }; |
216 | 219 |
217 // Export | 220 // Export |
218 return { | 221 return { |
219 MobileSetup: MobileSetup | 222 MobileSetup: MobileSetup |
220 }; | 223 }; |
221 | 224 |
222 }); | 225 }); |
223 | 226 |
OLD | NEW |