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

Unified Diff: ui/login/account_picker/md_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
Index: ui/login/account_picker/md_user_pod_row.js
diff --git a/ui/login/account_picker/md_user_pod_row.js b/ui/login/account_picker/md_user_pod_row.js
index e9b7f6a01ec372d3b1b55448d186e75e4a223e09..bf8dd80fcf4a183ab2960c4ab6f64fe7e668b80d 100644
--- a/ui/login/account_picker/md_user_pod_row.js
+++ b/ui/login/account_picker/md_user_pod_row.js
@@ -127,6 +127,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;
@@ -1269,12 +1278,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 | « chrome/browser/chromeos/login/users/multi_profile_user_controller.cc ('k') | ui/login/account_picker/user_pod_row.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698