Chromium Code Reviews| Index: chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.js |
| diff --git a/chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.js b/chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.js |
| index 1a5a588aeaf2b0218fe2de5ed184d2afa10753ce..f506034a8b3c3b5913ccc45e92c29653864b7b18 100644 |
| --- a/chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.js |
| +++ b/chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.js |
| @@ -11,6 +11,7 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() { |
| })();`; |
| /** @const */ var STEP_SIGNIN = 'signin'; |
| + /** @const */ var STEP_AD_JOIN = 'ad-join'; |
| /** @const */ var STEP_WORKING = 'working'; |
| /** @const */ var STEP_ATTRIBUTE_PROMPT = 'attribute-prompt'; |
| /** @const */ var STEP_ERROR = 'error'; |
| @@ -29,6 +30,7 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() { |
| 'doReload', |
| 'showAttributePromptStep', |
| 'showAttestationBasedEnrollmentSuccess', |
| + 'invalidateAD', |
| ], |
| /** |
| @@ -59,6 +61,8 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() { |
| */ |
| navigation_: undefined, |
| + offline_ad_ui_: undefined, |
|
xiyuan
2016/10/26 22:03:16
offline_ad_ui_ -> offlineAdUi_ to fit JS var name
Roman Sorokin (ftl)
2016/10/27 13:10:45
Done.
|
| + |
| /** |
| * Value contained in the last received 'backButton' event. |
| * @type {boolean} |
| @@ -69,6 +73,7 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() { |
| /** @override */ |
| decorate: function() { |
| this.navigation_ = $('oauth-enroll-navigation'); |
| + this.offline_ad_ui_ = $('oauth-enroll-ad-join-ui'); |
| this.authenticator_ = |
| new cr.login.Authenticator($('oauth-enroll-auth-view')); |
| @@ -112,6 +117,14 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() { |
| detail.authCode]); |
| }).bind(this)); |
| + this.offline_ad_ui_.addEventListener('authCompleted', |
| + (function(e) { |
| + this.offline_ad_ui_.disabled = true; |
| + chrome.send('oauthEnrollADCompleteLogin', |
| + [e.detail.machinename, e.detail.username, e.detail.password]); |
| + }).bind(this)); |
| + |
| + |
|
xiyuan
2016/10/26 22:03:16
nit: nuke one empty line ?
Roman Sorokin (ftl)
2016/10/27 13:10:45
Done.
|
| this.authenticator_.addEventListener('authFlowChange', |
| (function(e) { |
| var isSAML = this.authenticator_.authFlow == |
| @@ -167,7 +180,9 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() { |
| this.navigation_.addEventListener('back', function() { |
| this.navigation_.backVisible = false; |
| - $('oauth-enroll-auth-view').back(); |
| + if (this.currentStep_ == STEP_SIGNIN) { |
| + $('oauth-enroll-auth-view').back(); |
| + } |
|
xiyuan
2016/10/26 22:03:16
What would "back" do for STEP_AD_JOIN ?
Roman Sorokin (ftl)
2016/10/27 13:10:45
We don't show the button on domain join screen yet
|
| }.bind(this)); |
| $('oauth-enroll-attribute-prompt-card').addEventListener('submit', |
| @@ -294,6 +309,9 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() { |
| $('oauth-enroll-asset-id').focus(); |
| } else if (step == STEP_ATTRIBUTE_PROMPT_ERROR) { |
| $('oauth-enroll-attribute-prompt-error-card').submitButton.focus(); |
| + } else if (step == STEP_AD_JOIN) { |
| + this.offline_ad_ui_.disabled = false; |
| + this.offline_ad_ui_.setUser(); |
| } |
| this.currentStep_ = step; |
| @@ -325,6 +343,11 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() { |
| this.updateControlsState(); |
| }, |
| + invalidateAD: function(machineName, user) { |
| + this.offline_ad_ui_.disabled = false; |
| + this.offline_ad_ui_.setUser(user, machineName); |
| + }, |
| + |
| /** |
| * Retries the enrollment process after an error occurred in a previous |
| * attempt. This goes to the C++ side through |chrome| first to clean up the |
| @@ -366,12 +389,14 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() { |
| * Updates visibility of navigation buttons. |
| */ |
| updateControlsState: function() { |
| - this.navigation_.backVisible = this.currentStep_ == STEP_SIGNIN && |
| + this.navigation_.backVisible = (this.currentStep_ == STEP_SIGNIN || |
| + this.currentStep_ == STEP_AD_JOIN) && |
| this.lastBackMessageValue_; |
| this.navigation_.refreshVisible = this.isAtTheBeginning() && |
| !this.isManualEnrollment_; |
| this.navigation_.closeVisible = (this.currentStep_ == STEP_SIGNIN || |
| - this.currentStep_ == STEP_ERROR) && |
| + this.currentStep_ == STEP_ERROR || |
| + this.currentStep_ == STEP_AD_JOIN) && |
| !this.navigation_.refreshVisible; |
| $('login-header-bar').updateUI_(); |
| } |