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 cr.define('mobile', function() { | 6 cr.define('mobile', function() { |
7 | 7 |
8 function MobileSetup() { | 8 function MobileSetup() { |
9 } | 9 } |
10 | 10 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 } else if (e.data.type == 'framePostReady') { | 125 } else if (e.data.type == 'framePostReady') { |
126 this.frameLoadIgnored_ = false; | 126 this.frameLoadIgnored_ = false; |
127 this.sendPostFrame_(e.origin); | 127 this.sendPostFrame_(e.origin); |
128 } else if (e.data.type == 'reportTransactionStatusMsg') { | 128 } else if (e.data.type == 'reportTransactionStatusMsg') { |
129 console.log('calling setTransactionStatus from onMessageReceived_'); | 129 console.log('calling setTransactionStatus from onMessageReceived_'); |
130 chrome.send('setTransactionStatus', [e.data.status]); | 130 chrome.send('setTransactionStatus', [e.data.status]); |
131 } | 131 } |
132 }, | 132 }, |
133 | 133 |
134 changeState_: function(deviceInfo) { | 134 changeState_: function(deviceInfo) { |
135 var new_state = deviceInfo.state; | 135 var newState = deviceInfo.state; |
136 if (this.state_ == new_state) | 136 if (this.state_ == newState) |
137 return; | 137 return; |
138 var main = $('mainbody'); | 138 var main = $('mainbody'); |
139 // Map handler state to UX. | 139 // Map handler state to UX. |
140 switch (new_state) { | 140 switch (newState) { |
141 case MobileSetup.PLAN_ACTIVATION_PAGE_LOADING: | 141 case MobileSetup.PLAN_ACTIVATION_PAGE_LOADING: |
142 case MobileSetup.PLAN_ACTIVATION_START: | 142 case MobileSetup.PLAN_ACTIVATION_START: |
143 case MobileSetup.PLAN_ACTIVATION_DELAY_OTASP: | 143 case MobileSetup.PLAN_ACTIVATION_DELAY_OTASP: |
144 case MobileSetup.PLAN_ACTIVATION_START_OTASP: | 144 case MobileSetup.PLAN_ACTIVATION_START_OTASP: |
145 case MobileSetup.PLAN_ACTIVATION_RECONNECTING: | 145 case MobileSetup.PLAN_ACTIVATION_RECONNECTING: |
146 case MobileSetup.PLAN_ACTIVATION_RECONNECTING_PAYMENT: | 146 case MobileSetup.PLAN_ACTIVATION_RECONNECTING_PAYMENT: |
147 $('statusHeader').textContent = | 147 $('statusHeader').textContent = |
148 MobileSetup.localStrings_.getString('connecting_header'); | 148 MobileSetup.localStrings_.getString('connecting_header'); |
149 $('auxHeader').textContent = | 149 $('auxHeader').textContent = |
150 MobileSetup.localStrings_.getString('please_wait'); | 150 MobileSetup.localStrings_.getString('please_wait'); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 $('canvas').classList.add('hidden'); | 222 $('canvas').classList.add('hidden'); |
223 this.stopSpinner_(); | 223 this.stopSpinner_(); |
224 if (this.paymentShown_) { | 224 if (this.paymentShown_) { |
225 $('closeButton').classList.remove('hidden'); | 225 $('closeButton').classList.remove('hidden'); |
226 } else { | 226 } else { |
227 $('closeButton').classList.add('hidden'); | 227 $('closeButton').classList.add('hidden'); |
228 } | 228 } |
229 $('finalStatus').classList.remove('hidden'); | 229 $('finalStatus').classList.remove('hidden'); |
230 break; | 230 break; |
231 } | 231 } |
232 this.state_ = new_state; | 232 this.state_ = newState; |
233 }, | 233 }, |
234 | 234 |
235 updateDeviceStatus_: function(deviceInfo) { | 235 updateDeviceStatus_: function(deviceInfo) { |
236 this.changeState_(deviceInfo); | 236 this.changeState_(deviceInfo); |
237 }, | 237 }, |
238 | 238 |
239 portalFrameLoadError_: function(errorCode) { | 239 portalFrameLoadError_: function(errorCode) { |
240 if (this.frameLoadIgnored_) | 240 if (this.frameLoadIgnored_) |
241 return; | 241 return; |
242 console.log('Portal frame load error detected: ', errorCode); | 242 console.log('Portal frame load error detected: ', errorCode); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 mobile.MobileSetup.ACTIVATION_PAGE_URL); | 327 mobile.MobileSetup.ACTIVATION_PAGE_URL); |
328 }; | 328 }; |
329 | 329 |
330 // Export | 330 // Export |
331 return { | 331 return { |
332 MobileSetup: MobileSetup | 332 MobileSetup: MobileSetup |
333 }; | 333 }; |
334 | 334 |
335 }); | 335 }); |
336 | 336 |
OLD | NEW |