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 * @fileoverview Oobe signin screen implementation. | 6 * @fileoverview Oobe signin screen implementation. |
7 */ | 7 */ |
8 | 8 |
9 cr.define('login', function() { | 9 cr.define('login', function() { |
10 // Gaia loading time after which portal check should be fired. | 10 // Gaia loading time after which portal check should be fired. |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 var msg = e.data; | 307 var msg = e.data; |
308 console.log('GaiaSigninScreen.onMessage_: method=' + msg.method); | 308 console.log('GaiaSigninScreen.onMessage_: method=' + msg.method); |
309 | 309 |
310 if (msg.method == 'completeLogin') { | 310 if (msg.method == 'completeLogin') { |
311 chrome.send('completeLogin', [msg.email, msg.password]); | 311 chrome.send('completeLogin', [msg.email, msg.password]); |
312 this.loading = true; | 312 this.loading = true; |
313 // Now that we're in logged in state header should be hidden. | 313 // Now that we're in logged in state header should be hidden. |
314 Oobe.getInstance().headerHidden = true; | 314 Oobe.getInstance().headerHidden = true; |
315 // Clear any error messages that were shown before login. | 315 // Clear any error messages that were shown before login. |
316 Oobe.clearErrors(); | 316 Oobe.clearErrors(); |
| 317 } else if (msg.method == 'completeAuthentication') { |
| 318 chrome.send('completeAuthentication', [msg.email, |
| 319 msg.password, |
| 320 msg.authCode]); |
| 321 this.loading = true; |
| 322 // Now that we're in logged in state header should be hidden. |
| 323 Oobe.getInstance().headerHidden = true; |
| 324 // Clear any error messages that were shown before login. |
| 325 Oobe.clearErrors(); |
317 } else if (msg.method == 'loginUILoaded') { | 326 } else if (msg.method == 'loginUILoaded') { |
318 this.loading = false; | 327 this.loading = false; |
319 chrome.send('loginScreenUpdate'); | 328 chrome.send('loginScreenUpdate'); |
320 this.clearLoadingTimer_(); | 329 this.clearLoadingTimer_(); |
321 // Show deferred error bubble. | 330 // Show deferred error bubble. |
322 if (this.errorBubble_) { | 331 if (this.errorBubble_) { |
323 this.showErrorBubble(this.errorBubble_[0], this.errorBubble_[1]); | 332 this.showErrorBubble(this.errorBubble_[0], this.errorBubble_[1]); |
324 this.errorBubble_ = undefined; | 333 this.errorBubble_ = undefined; |
325 } | 334 } |
326 chrome.send('loginWebuiReady'); | 335 chrome.send('loginWebuiReady'); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 // Check current network state if currentScreen is a Gaia signin. | 488 // Check current network state if currentScreen is a Gaia signin. |
480 var currentScreen = Oobe.getInstance().currentScreen; | 489 var currentScreen = Oobe.getInstance().currentScreen; |
481 if (currentScreen.id == SCREEN_GAIA_SIGNIN) | 490 if (currentScreen.id == SCREEN_GAIA_SIGNIN) |
482 chrome.send('showGaiaFrameError', [error]); | 491 chrome.send('showGaiaFrameError', [error]); |
483 }; | 492 }; |
484 | 493 |
485 return { | 494 return { |
486 GaiaSigninScreen: GaiaSigninScreen | 495 GaiaSigninScreen: GaiaSigninScreen |
487 }; | 496 }; |
488 }); | 497 }); |
OLD | NEW |