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