| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 Oobe signin screen implementation. | 6 * @fileoverview Oobe signin screen implementation. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 login.createScreen('GaiaSigninScreen', 'gaia-signin', function() { | 9 login.createScreen('GaiaSigninScreen', 'gaia-signin', function() { |
| 10 // GAIA animation guard timer. Started when GAIA page is loaded | 10 // GAIA animation guard timer. Started when GAIA page is loaded |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 this.gaiaAuthHost_.insecureContentBlockedCallback = | 208 this.gaiaAuthHost_.insecureContentBlockedCallback = |
| 209 this.onInsecureContentBlocked_.bind(this); | 209 this.onInsecureContentBlocked_.bind(this); |
| 210 this.gaiaAuthHost_.missingGaiaInfoCallback = | 210 this.gaiaAuthHost_.missingGaiaInfoCallback = |
| 211 this.missingGaiaInfo_.bind(this); | 211 this.missingGaiaInfo_.bind(this); |
| 212 this.gaiaAuthHost_.samlApiUsedCallback = | 212 this.gaiaAuthHost_.samlApiUsedCallback = |
| 213 this.samlApiUsed_.bind(this); | 213 this.samlApiUsed_.bind(this); |
| 214 this.gaiaAuthHost_.addEventListener('authDomainChange', | 214 this.gaiaAuthHost_.addEventListener('authDomainChange', |
| 215 this.onAuthDomainChange_.bind(this)); | 215 this.onAuthDomainChange_.bind(this)); |
| 216 this.gaiaAuthHost_.addEventListener('authFlowChange', | 216 this.gaiaAuthHost_.addEventListener('authFlowChange', |
| 217 this.onAuthFlowChange_.bind(this)); | 217 this.onAuthFlowChange_.bind(this)); |
| 218 this.gaiaAuthHost_.addEventListener('videoEnabledChange', |
| 219 this.onVideoEnabledChange_.bind(this)); |
| 218 | 220 |
| 219 this.gaiaAuthHost_.addEventListener('loadAbort', | 221 this.gaiaAuthHost_.addEventListener('loadAbort', |
| 220 this.onLoadAbortMessage_.bind(this)); | 222 this.onLoadAbortMessage_.bind(this)); |
| 221 this.gaiaAuthHost_.addEventListener( | 223 this.gaiaAuthHost_.addEventListener( |
| 222 'identifierEntered', this.onIdentifierEnteredMessage_.bind(this)); | 224 'identifierEntered', this.onIdentifierEnteredMessage_.bind(this)); |
| 223 | 225 |
| 224 this.navigation_.addEventListener('back', function() { | 226 this.navigation_.addEventListener('back', function() { |
| 225 this.navigation_.backVisible = false; | 227 this.navigation_.backVisible = false; |
| 226 this.getSigninFrame_().back(); | 228 this.getSigninFrame_().back(); |
| 227 }.bind(this)); | 229 }.bind(this)); |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 | 598 |
| 597 /** | 599 /** |
| 598 * Whether the current auth flow is SAML. | 600 * Whether the current auth flow is SAML. |
| 599 */ | 601 */ |
| 600 isSAML: function() { | 602 isSAML: function() { |
| 601 return this.gaiaAuthHost_.authFlow == | 603 return this.gaiaAuthHost_.authFlow == |
| 602 cr.login.GaiaAuthHost.AuthFlow.SAML; | 604 cr.login.GaiaAuthHost.AuthFlow.SAML; |
| 603 }, | 605 }, |
| 604 | 606 |
| 605 /** | 607 /** |
| 608 * Helper function to update the title bar. |
| 609 */ |
| 610 updateSamlNotice_: function() { |
| 611 if (this.gaiaAuthHost_.videoEnabled) { |
| 612 $('saml-notice-message').textContent = loadTimeData.getStringF( |
| 613 'samlNoticeWithVideo', |
| 614 this.gaiaAuthHost_.authDomain); |
| 615 $('saml-notice-recording-indicator').hidden = false; |
| 616 $('saml-notice-container').style.justifyContent = 'flex-start'; |
| 617 } else { |
| 618 $('saml-notice-message').textContent = loadTimeData.getStringF( |
| 619 'samlNotice', |
| 620 this.gaiaAuthHost_.authDomain); |
| 621 $('saml-notice-recording-indicator').hidden = true; |
| 622 $('saml-notice-container').style.justifyContent = 'center'; |
| 623 } |
| 624 }, |
| 625 |
| 626 /** |
| 606 * Invoked when the authDomain property is changed on the GAIA host. | 627 * Invoked when the authDomain property is changed on the GAIA host. |
| 607 */ | 628 */ |
| 608 onAuthDomainChange_: function() { | 629 onAuthDomainChange_: function() { |
| 609 $('saml-notice-message').textContent = loadTimeData.getStringF( | 630 this.updateSamlNotice_(); |
| 610 'samlNotice', | |
| 611 this.gaiaAuthHost_.authDomain); | |
| 612 }, | 631 }, |
| 613 | 632 |
| 614 /** | 633 /** |
| 634 * Invoked when the videoEnabled property is changed on the GAIA host. |
| 635 */ |
| 636 onVideoEnabledChange_: function() { |
| 637 this.updateSamlNotice_(); |
| 638 }, |
| 639 |
| 640 /** |
| 615 * Invoked when the authFlow property is changed on the GAIA host. | 641 * Invoked when the authFlow property is changed on the GAIA host. |
| 616 */ | 642 */ |
| 617 onAuthFlowChange_: function() { | 643 onAuthFlowChange_: function() { |
| 618 var isSAML = this.isSAML(); | 644 var isSAML = this.isSAML(); |
| 619 | 645 |
| 620 this.classList.toggle('full-width', isSAML); | 646 this.classList.toggle('full-width', isSAML); |
| 621 $('saml-notice-container').hidden = !isSAML; | 647 $('saml-notice-container').hidden = !isSAML; |
| 622 | 648 |
| 623 if (Oobe.getInstance().currentScreen === this) { | 649 if (Oobe.getInstance().currentScreen === this) { |
| 624 Oobe.getInstance().updateScreenSize(this); | 650 Oobe.getInstance().updateScreenSize(this); |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 this.classList.toggle('whitelist-error', show); | 1010 this.classList.toggle('whitelist-error', show); |
| 985 this.loading = !show; | 1011 this.loading = !show; |
| 986 | 1012 |
| 987 if (!show) | 1013 if (!show) |
| 988 Oobe.showSigninUI(); | 1014 Oobe.showSigninUI(); |
| 989 | 1015 |
| 990 this.updateControlsState(); | 1016 this.updateControlsState(); |
| 991 } | 1017 } |
| 992 }; | 1018 }; |
| 993 }); | 1019 }); |
| OLD | NEW |