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

Unified Diff: ui/login/account_picker/user_pod_row.js

Issue 2946463002: Convert multi-profile user behavior string to enum and send it to UI. (Closed)
Patch Set: Created 3 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 | « ui/login/account_picker/md_user_pod_row.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/login/account_picker/user_pod_row.js
diff --git a/ui/login/account_picker/user_pod_row.js b/ui/login/account_picker/user_pod_row.js
index ec915dce20feed8f0a6853750d6450ec9136bcc2..79690759f84487ee9e508fa4b56c842ed58fc02b 100644
--- a/ui/login/account_picker/user_pod_row.js
+++ b/ui/login/account_picker/user_pod_row.js
@@ -150,6 +150,15 @@ cr.define('login', function() {
{state: FINGERPRINT_STATES.FAILED, class: 'failed'}
];
+ // Supported multi-profile user behavior values.
+ // Keep in sync with the enum in multi_profile_user_controller.h
+ var MULTI_PROFILE_USER_BEHAVIOR = {
+ UNRESTRICTED: 0,
+ PRIMARY_ONLY: 1,
+ NOT_ALLOWED: 2,
+ OWNER_PRIMARY_ONLY: 3
+ };
+
// Focus and tab order are organized as follows:
//
// (1) all user pods have tab index 1 so they are traversed first;
@@ -1210,12 +1219,15 @@ cr.define('login', function() {
this.classList.add('multiprofiles-policy-applied');
this.setUserPodIconType('policy');
- if (this.user.multiProfilesPolicy == 'primary-only')
+ if (this.user.multiProfilesPolicy ==
+ MULTI_PROFILE_USER_BEHAVIOR.PRIMARY_ONLY) {
this.querySelector('.mp-policy-primary-only-msg').hidden = false;
- else if (this.user.multiProfilesPolicy == 'owner-primary-only')
+ } else if (this.user.multiProfilesPolicy ==
+ MULTI_PROFILE_USER_BEHAVIOR.OWNER_PRIMARY_ONLY) {
this.querySelector('.mp-owner-primary-only-msg').hidden = false;
- else
+ } else {
this.querySelector('.mp-policy-not-allowed-msg').hidden = false;
+ }
} else if (this.user_.isApp) {
this.setUserPodIconType('app');
}
« no previous file with comments | « ui/login/account_picker/md_user_pod_row.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698