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

Unified Diff: chrome/browser/resources/login/user_pod_row.js

Issue 341453002: [multi-profiles] Allow bringing up sign in UI even if all users are restricted per their policies (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 6 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
« no previous file with comments | « chrome/browser/resources/login/user_pod_row.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/login/user_pod_row.js
diff --git a/chrome/browser/resources/login/user_pod_row.js b/chrome/browser/resources/login/user_pod_row.js
index 51b538a424b78777184c4d7cad65821dd7b8ac5c..d7fc01faa63f784fd0f189ec2c59442484135939 100644
--- a/chrome/browser/resources/login/user_pod_row.js
+++ b/chrome/browser/resources/login/user_pod_row.js
@@ -363,6 +363,14 @@ cr.define('login', function() {
},
/**
+ * Gets user type bubble like multi-profiles policy restriction message.
+ * @type {!HTMLDivElement}
+ */
+ get userTypeBubbleElement() {
+ return this.querySelector('.user-type-bubble');
+ },
+
+ /**
* Gets user type icon.
* @type {!HTMLDivElement}
*/
@@ -525,12 +533,9 @@ cr.define('login', function() {
},
customizeUserPodPerUserType: function() {
- var isMultiProfilesUI =
- (Oobe.getInstance().displayType == DISPLAY_TYPE.USER_ADDING);
-
if (this.user_.locallyManagedUser && !this.user_.isDesktopUser) {
this.setUserPodIconType('supervised');
- } else if (isMultiProfilesUI && !this.user_.isMultiProfilesAllowed) {
+ } else if (this.multiProfilesPolicyApplied) {
// Mark user pod as not focusable which in addition to the grayed out
// filter makes it look in disabled state.
this.classList.add('not-focusable');
@@ -567,6 +572,17 @@ cr.define('login', function() {
},
/**
+ * Returns true if multi-profiles sign in is currently active and this
+ * user pod is restricted per policy.
+ * @type {boolean}
+ */
+ get multiProfilesPolicyApplied() {
+ var isMultiProfilesUI =
+ (Oobe.getInstance().displayType == DISPLAY_TYPE.USER_ADDING);
+ return isMultiProfilesUI && !this.user_.isMultiProfilesAllowed;
+ },
+
+ /**
* Gets main input element.
* @type {(HTMLButtonElement|HTMLInputElement)}
*/
@@ -622,6 +638,8 @@ cr.define('login', function() {
this.actionBoxAreaElement.classList.add('hovered');
this.classList.add('hovered');
} else {
+ if (this.multiProfilesPolicyApplied)
+ this.userTypeBubbleElement.classList.remove('bubble-shown');
this.actionBoxAreaElement.classList.remove('hovered');
this.classList.remove('hovered');
}
@@ -752,6 +770,11 @@ cr.define('login', function() {
if (this.user.locallyManagedUser && !this.user.isDesktopUser) {
this.showSupervisedUserSigninWarning();
} else {
+ // Special case for multi-profiles sign in. We show users even if they
+ // are not allowed per policy. Restrict those users from starting GAIA.
+ if (this.multiProfilesPolicyApplied)
+ return;
+
this.parentNode.showSigninUI(this.user.emailAddress);
}
},
@@ -898,6 +921,9 @@ cr.define('login', function() {
this.parentNode.setActivatedPod(this);
}
+ if (this.multiProfilesPolicyApplied)
+ this.userTypeBubbleElement.classList.add('bubble-shown');
+
// Prevent default so that we don't trigger 'focus' event.
e.preventDefault();
}
@@ -1963,6 +1989,9 @@ cr.define('login', function() {
*/
focusPod: function(podToFocus, opt_force) {
if (this.isFocused(podToFocus) && !opt_force) {
+ // Calling focusPod w/o podToFocus means reset.
+ if (!podToFocus)
+ Oobe.clearErrors();
this.keyboardActivated_ = false;
return;
}
« no previous file with comments | « chrome/browser/resources/login/user_pod_row.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698