OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 An UI component to host gaia auth extension in an iframe. | 6 * @fileoverview An UI component to host gaia auth extension in an iframe. |
7 * After the component binds with an iframe, call its {@code load} to start the | 7 * After the component binds with an iframe, call its {@code load} to start the |
8 * authentication flow. There are two events would be raised after this point: | 8 * authentication flow. There are two events would be raised after this point: |
9 * a 'ready' event when the authentication UI is ready to use and a 'completed' | 9 * a 'ready' event when the authentication UI is ready to use and a 'completed' |
10 * event when the authentication is completed successfully. If caller is | 10 * event when the authentication is completed successfully. If caller is |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 var msg = {method: 'redirectToSignin'}; | 364 var msg = {method: 'redirectToSignin'}; |
365 this.frame_.contentWindow.postMessage(msg, AUTH_URL_BASE); | 365 this.frame_.contentWindow.postMessage(msg, AUTH_URL_BASE); |
366 return; | 366 return; |
367 } | 367 } |
368 this.onAuthSuccess_({authCodeOnly: true, authCode: msg.authCode}); | 368 this.onAuthSuccess_({authCodeOnly: true, authCode: msg.authCode}); |
369 return; | 369 return; |
370 } | 370 } |
371 | 371 |
372 if (msg.method == 'confirmPassword') { | 372 if (msg.method == 'confirmPassword') { |
373 if (this.confirmPasswordCallback_) | 373 if (this.confirmPasswordCallback_) |
374 this.confirmPasswordCallback_(msg.passwordCount); | 374 this.confirmPasswordCallback_(msg.email, msg.passwordCount); |
375 else | 375 else |
376 console.error('GaiaAuthHost: Invalid confirmPasswordCallback_.'); | 376 console.error('GaiaAuthHost: Invalid confirmPasswordCallback_.'); |
377 return; | 377 return; |
378 } | 378 } |
379 | 379 |
380 if (msg.method == 'noPassword') { | 380 if (msg.method == 'noPassword') { |
381 if (this.noPasswordCallback_) | 381 if (this.noPasswordCallback_) |
382 this.noPasswordCallback_(msg.email); | 382 this.noPasswordCallback_(msg.email); |
383 else | 383 else |
384 console.error('GaiaAuthHost: Invalid noPasswordCallback_.'); | 384 console.error('GaiaAuthHost: Invalid noPasswordCallback_.'); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 | 447 |
448 GaiaAuthHost.SUPPORTED_PARAMS = SUPPORTED_PARAMS; | 448 GaiaAuthHost.SUPPORTED_PARAMS = SUPPORTED_PARAMS; |
449 GaiaAuthHost.LOCALIZED_STRING_PARAMS = LOCALIZED_STRING_PARAMS; | 449 GaiaAuthHost.LOCALIZED_STRING_PARAMS = LOCALIZED_STRING_PARAMS; |
450 GaiaAuthHost.AuthMode = AuthMode; | 450 GaiaAuthHost.AuthMode = AuthMode; |
451 GaiaAuthHost.AuthFlow = AuthFlow; | 451 GaiaAuthHost.AuthFlow = AuthFlow; |
452 | 452 |
453 return { | 453 return { |
454 GaiaAuthHost: GaiaAuthHost | 454 GaiaAuthHost: GaiaAuthHost |
455 }; | 455 }; |
456 }); | 456 }); |
OLD | NEW |