| 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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 } | 339 } |
| 340 | 340 |
| 341 if (/^complete(Login|Authentication)$|^offlineLogin$/.test(msg.method)) { | 341 if (/^complete(Login|Authentication)$|^offlineLogin$/.test(msg.method)) { |
| 342 if (!msg.email && !this.email_ && !msg.skipForNow) { | 342 if (!msg.email && !this.email_ && !msg.skipForNow) { |
| 343 var msg = {method: 'redirectToSignin'}; | 343 var msg = {method: 'redirectToSignin'}; |
| 344 this.frame_.contentWindow.postMessage(msg, AUTH_URL_BASE); | 344 this.frame_.contentWindow.postMessage(msg, AUTH_URL_BASE); |
| 345 return; | 345 return; |
| 346 } | 346 } |
| 347 this.onAuthSuccess_({email: msg.email, | 347 this.onAuthSuccess_({email: msg.email, |
| 348 password: msg.password, | 348 password: msg.password, |
| 349 gaiaId: msg.gaiaId, |
| 349 useOffline: msg.method == 'offlineLogin', | 350 useOffline: msg.method == 'offlineLogin', |
| 350 usingSAML: msg.usingSAML || false, | 351 usingSAML: msg.usingSAML || false, |
| 351 chooseWhatToSync: msg.chooseWhatToSync, | 352 chooseWhatToSync: msg.chooseWhatToSync, |
| 352 skipForNow: msg.skipForNow || false, | 353 skipForNow: msg.skipForNow || false, |
| 353 sessionIndex: msg.sessionIndex || ''}); | 354 sessionIndex: msg.sessionIndex || ''}); |
| 354 return; | 355 return; |
| 355 } | 356 } |
| 356 | 357 |
| 357 if (msg.method == 'retrieveAuthenticatedUserEmail') { | 358 if (msg.method == 'retrieveAuthenticatedUserEmail') { |
| 358 if (this.retrieveAuthenticatedUserEmailCallback_) { | 359 if (this.retrieveAuthenticatedUserEmailCallback_) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 | 415 |
| 415 GaiaAuthHost.SUPPORTED_PARAMS = SUPPORTED_PARAMS; | 416 GaiaAuthHost.SUPPORTED_PARAMS = SUPPORTED_PARAMS; |
| 416 GaiaAuthHost.LOCALIZED_STRING_PARAMS = LOCALIZED_STRING_PARAMS; | 417 GaiaAuthHost.LOCALIZED_STRING_PARAMS = LOCALIZED_STRING_PARAMS; |
| 417 GaiaAuthHost.AuthMode = AuthMode; | 418 GaiaAuthHost.AuthMode = AuthMode; |
| 418 GaiaAuthHost.AuthFlow = AuthFlow; | 419 GaiaAuthHost.AuthFlow = AuthFlow; |
| 419 | 420 |
| 420 return { | 421 return { |
| 421 GaiaAuthHost: GaiaAuthHost | 422 GaiaAuthHost: GaiaAuthHost |
| 422 }; | 423 }; |
| 423 }); | 424 }); |
| OLD | NEW |