| 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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 * @param {object} e Payload of the received HTML5 message. | 505 * @param {object} e Payload of the received HTML5 message. |
| 506 * @private | 506 * @private |
| 507 */ | 507 */ |
| 508 Authenticator.prototype.onMessageFromWebview_ = function(e) { | 508 Authenticator.prototype.onMessageFromWebview_ = function(e) { |
| 509 if (!this.isGaiaMessage(e)) | 509 if (!this.isGaiaMessage(e)) |
| 510 return; | 510 return; |
| 511 | 511 |
| 512 var msg = e.data; | 512 var msg = e.data; |
| 513 if (msg.method == 'attemptLogin') { | 513 if (msg.method == 'attemptLogin') { |
| 514 this.email_ = msg.email; | 514 this.email_ = msg.email; |
| 515 if (this.authMode == AuthMode.DESKTOP) |
| 516 this.password_ = msg.password; |
| 517 |
| 515 this.chooseWhatToSync_ = msg.chooseWhatToSync; | 518 this.chooseWhatToSync_ = msg.chooseWhatToSync; |
| 516 // We need to dispatch only first event, before user enters password. | 519 // We need to dispatch only first event, before user enters password. |
| 517 this.dispatchEvent( | 520 this.dispatchEvent( |
| 518 new CustomEvent('attemptLogin', {detail: msg.email})); | 521 new CustomEvent('attemptLogin', {detail: msg.email})); |
| 519 } else if (msg.method == 'dialogShown') { | 522 } else if (msg.method == 'dialogShown') { |
| 520 this.dispatchEvent(new Event('dialogShown')); | 523 this.dispatchEvent(new Event('dialogShown')); |
| 521 } else if (msg.method == 'dialogHidden') { | 524 } else if (msg.method == 'dialogHidden') { |
| 522 this.dispatchEvent(new Event('dialogHidden')); | 525 this.dispatchEvent(new Event('dialogHidden')); |
| 523 } else if (msg.method == 'backButton') { | 526 } else if (msg.method == 'backButton') { |
| 524 this.dispatchEvent(new CustomEvent('backButton', {detail: msg.show})); | 527 this.dispatchEvent(new CustomEvent('backButton', {detail: msg.show})); |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 Authenticator.AuthMode = AuthMode; | 770 Authenticator.AuthMode = AuthMode; |
| 768 Authenticator.SUPPORTED_PARAMS = SUPPORTED_PARAMS; | 771 Authenticator.SUPPORTED_PARAMS = SUPPORTED_PARAMS; |
| 769 | 772 |
| 770 return { | 773 return { |
| 771 // TODO(guohui, xiyuan): Rename GaiaAuthHost to Authenticator once the old | 774 // TODO(guohui, xiyuan): Rename GaiaAuthHost to Authenticator once the old |
| 772 // iframe-based flow is deprecated. | 775 // iframe-based flow is deprecated. |
| 773 GaiaAuthHost: Authenticator, | 776 GaiaAuthHost: Authenticator, |
| 774 Authenticator: Authenticator | 777 Authenticator: Authenticator |
| 775 }; | 778 }; |
| 776 }); | 779 }); |
| OLD | NEW |