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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 if (/^complete(Login|Authentication)$|^offlineLogin$/.test(msg.method)) { | 348 if (/^complete(Login|Authentication)$|^offlineLogin$/.test(msg.method)) { |
349 if (!msg.email && !this.email_ && !msg.skipForNow) { | 349 if (!msg.email && !this.email_ && !msg.skipForNow) { |
350 var msg = {method: 'redirectToSignin'}; | 350 var msg = {method: 'redirectToSignin'}; |
351 this.frame_.contentWindow.postMessage(msg, AUTH_URL_BASE); | 351 this.frame_.contentWindow.postMessage(msg, AUTH_URL_BASE); |
352 return; | 352 return; |
353 } | 353 } |
354 this.onAuthSuccess_({email: msg.email || this.email_, | 354 this.onAuthSuccess_({email: msg.email || this.email_, |
355 password: msg.password || this.password_, | 355 password: msg.password || this.password_, |
356 authCode: msg.authCode, | 356 authCode: msg.authCode, |
357 useOffline: msg.method == 'offlineLogin', | 357 useOffline: msg.method == 'offlineLogin', |
358 usingSAML: msg.usingSAML || false, | |
359 chooseWhatToSync: this.chooseWhatToSync_, | 358 chooseWhatToSync: this.chooseWhatToSync_, |
360 skipForNow: msg.skipForNow || false }); | 359 skipForNow: msg.skipForNow || false }); |
361 return; | 360 return; |
362 } | 361 } |
363 | 362 |
364 if (msg.method == 'retrieveAuthenticatedUserEmail') { | 363 if (msg.method == 'retrieveAuthenticatedUserEmail') { |
365 if (this.retrieveAuthenticatedUserEmailCallback_) { | 364 if (this.retrieveAuthenticatedUserEmailCallback_) { |
366 this.retrieveAuthenticatedUserEmailCallback_(msg.attemptToken); | 365 this.retrieveAuthenticatedUserEmailCallback_(msg.attemptToken); |
367 } else { | 366 } else { |
368 console.error( | 367 console.error( |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 | 436 |
438 GaiaAuthHost.SUPPORTED_PARAMS = SUPPORTED_PARAMS; | 437 GaiaAuthHost.SUPPORTED_PARAMS = SUPPORTED_PARAMS; |
439 GaiaAuthHost.LOCALIZED_STRING_PARAMS = LOCALIZED_STRING_PARAMS; | 438 GaiaAuthHost.LOCALIZED_STRING_PARAMS = LOCALIZED_STRING_PARAMS; |
440 GaiaAuthHost.AuthMode = AuthMode; | 439 GaiaAuthHost.AuthMode = AuthMode; |
441 GaiaAuthHost.AuthFlow = AuthFlow; | 440 GaiaAuthHost.AuthFlow = AuthFlow; |
442 | 441 |
443 return { | 442 return { |
444 GaiaAuthHost: GaiaAuthHost | 443 GaiaAuthHost: GaiaAuthHost |
445 }; | 444 }; |
446 }); | 445 }); |
OLD | NEW |