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

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

Issue 2433363004: Chromad: added AD Join ui, authpolicy_client (Closed)
Patch Set: More polishing Created 4 years, 2 months 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..bebb1428248820d9f5eb3a3249ca421e45e59ef5 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,
Dan Beam 2016/10/28 21:13:03 can you document and/or type this? and maybe add
Roman Sorokin (ftl) 2016/10/31 11:37:10 Done.
+ offlineAdUi_: undefined,
+
/**
* 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.offlineAdUi_ = $('oauth-enroll-ad-join-ui');
this.authenticator_ =
new cr.login.Authenticator($('oauth-enroll-auth-view'));
@@ -112,6 +117,13 @@ 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));
Dan Beam 2016/10/28 21:13:03 these outer () aren't necessary, i.e. you can just
Roman Sorokin (ftl) 2016/10/31 11:37:10 Done.
+
this.authenticator_.addEventListener('authFlowChange',
(function(e) {
var isSAML = this.authenticator_.authFlow ==
@@ -167,7 +179,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) {
Dan Beam 2016/10/28 21:13:03 nit: no curlies
Roman Sorokin (ftl) 2016/10/31 11:37:11 Done.
+ $('oauth-enroll-auth-view').back();
+ }
}.bind(this));
$('oauth-enroll-attribute-prompt-card').addEventListener('submit',
@@ -294,6 +308,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 +342,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 +393,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