Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4402)

Unified Diff: chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.js

Issue 2433363004: Chromad: added AD Join ui, authpolicy_client (Closed)
Patch Set: nit Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..17b3e38e302dac7735b23193db1c759d4d0bbf39 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',
],
/**
@@ -60,6 +62,13 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() {
navigation_: undefined,
/**
+ * An element containing UI to join an AD domain.
+ * @type {OfflineAdLoginElement}
+ * @private
+ */
+ offlineAdUi_: undefined,
+
+ /**
* Value contained in the last received 'backButton' event.
* @type {boolean}
* @private
@@ -69,6 +78,7 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() {
/** @override */
decorate: function() {
this.navigation_ = $('oauth-enroll-navigation');
+ this.offlineAdUi_ = $('oauth-enroll-ad-join-ui');
this.authenticator_ =
new cr.login.Authenticator($('oauth-enroll-auth-view'));
@@ -112,6 +122,12 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() {
detail.authCode]);
}).bind(this));
+ this.offlineAdUi_.addEventListener('authCompleted', function(e) {
+ this.offlineAdUi_.disabled = true;
+ chrome.send('oauthEnrollAdCompleteLogin',
+ [e.detail.machinename, e.detail.username, e.detail.password]);
+ }.bind(this));
+
this.authenticator_.addEventListener('authFlowChange',
(function(e) {
var isSAML = this.authenticator_.authFlow ==
@@ -167,7 +183,8 @@ 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();
}.bind(this));
$('oauth-enroll-attribute-prompt-card').addEventListener('submit',
@@ -294,6 +311,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.offlineAdUi_.disabled = false;
+ this.offlineAdUi_.setUser();
}
this.currentStep_ = step;
@@ -325,6 +345,11 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() {
this.updateControlsState();
},
+ invalidateAd: function(machineName, user) {
+ this.offlineAdUi_.disabled = false;
+ this.offlineAdUi_.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
@@ -371,7 +396,8 @@ login.createScreen('OAuthEnrollmentScreen', 'oauth-enrollment', function() {
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_();
}

Powered by Google App Engine
This is Rietveld 408576698