| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <include src="saml_handler.js"> | 5 <include src="saml_handler.js"> |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @fileoverview An UI component to authenciate to Chrome. The component hosts | 8 * @fileoverview An UI component to authenciate to Chrome. The component hosts |
| 9 * IdP web pages in a webview. A client who is interested in monitoring | 9 * IdP web pages in a webview. A client who is interested in monitoring |
| 10 * authentication events should pass a listener object of type | 10 * authentication events should pass a listener object of type |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 | 349 |
| 350 var msg = e.data; | 350 var msg = e.data; |
| 351 if (msg.method == 'attemptLogin') { | 351 if (msg.method == 'attemptLogin') { |
| 352 this.email_ = msg.email; | 352 this.email_ = msg.email; |
| 353 this.password_ = msg.password; | 353 this.password_ = msg.password; |
| 354 this.chooseWhatToSync_ = msg.chooseWhatToSync; | 354 this.chooseWhatToSync_ = msg.chooseWhatToSync; |
| 355 } else if (msg.method == 'dialogShown') { | 355 } else if (msg.method == 'dialogShown') { |
| 356 this.dispatchEvent(new Event('dialogShown')); | 356 this.dispatchEvent(new Event('dialogShown')); |
| 357 } else if (msg.method == 'dialogHidden') { | 357 } else if (msg.method == 'dialogHidden') { |
| 358 this.dispatchEvent(new Event('dialogHidden')); | 358 this.dispatchEvent(new Event('dialogHidden')); |
| 359 } else if (msg.method == 'backButton') { |
| 360 this.dispatchEvent(new CustomEvent('backButton', {detail: msg.show})); |
| 359 } else { | 361 } else { |
| 360 console.warning('Unrecognized message from GAIA: ' + msg.method); | 362 console.warn('Unrecognized message from GAIA: ' + msg.method); |
| 361 } | 363 } |
| 362 }; | 364 }; |
| 363 | 365 |
| 364 /** | 366 /** |
| 365 * Invoked by the hosting page to verify the Saml password. | 367 * Invoked by the hosting page to verify the Saml password. |
| 366 */ | 368 */ |
| 367 Authenticator.prototype.verifyConfirmedPassword = function(password) { | 369 Authenticator.prototype.verifyConfirmedPassword = function(password) { |
| 368 if (!this.samlHandler_.verifyConfirmedPassword(password)) { | 370 if (!this.samlHandler_.verifyConfirmedPassword(password)) { |
| 369 // Invoke confirm password callback asynchronously because the | 371 // Invoke confirm password callback asynchronously because the |
| 370 // verification was based on messages and caller (GaiaSigninScreen) | 372 // verification was based on messages and caller (GaiaSigninScreen) |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 Authenticator.AuthFlow = AuthFlow; | 541 Authenticator.AuthFlow = AuthFlow; |
| 540 Authenticator.AuthMode = AuthMode; | 542 Authenticator.AuthMode = AuthMode; |
| 541 Authenticator.SUPPORTED_PARAMS = SUPPORTED_PARAMS; | 543 Authenticator.SUPPORTED_PARAMS = SUPPORTED_PARAMS; |
| 542 | 544 |
| 543 return { | 545 return { |
| 544 // TODO(guohui, xiyuan): Rename GaiaAuthHost to Authenticator once the old | 546 // TODO(guohui, xiyuan): Rename GaiaAuthHost to Authenticator once the old |
| 545 // iframe-based flow is deprecated. | 547 // iframe-based flow is deprecated. |
| 546 GaiaAuthHost: Authenticator | 548 GaiaAuthHost: Authenticator |
| 547 }; | 549 }; |
| 548 }); | 550 }); |
| OLD | NEW |