OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 namespace chromeos { | 28 namespace chromeos { |
29 | 29 |
30 namespace { | 30 namespace { |
31 | 31 |
32 // User dictionary keys. | 32 // User dictionary keys. |
33 const char kKeyUsername[] = "username"; | 33 const char kKeyUsername[] = "username"; |
34 const char kKeyDisplayName[] = "displayName"; | 34 const char kKeyDisplayName[] = "displayName"; |
35 const char kKeyEmailAddress[] = "emailAddress"; | 35 const char kKeyEmailAddress[] = "emailAddress"; |
36 const char kKeyEnterpriseDomain[] = "enterpriseDomain"; | 36 const char kKeyEnterpriseDomain[] = "enterpriseDomain"; |
37 const char kKeyPublicAccount[] = "publicAccount"; | 37 const char kKeyPublicAccount[] = "publicAccount"; |
38 const char kKeySupervisedUser[] = "supervisedUser"; | 38 const char kKeyLegacySupervisedUser[] = "legacySupervisedUser"; |
39 const char kKeyChildUser[] = "childUser"; | 39 const char kKeyChildUser[] = "childUser"; |
40 const char kKeyDesktopUser[] = "isDesktopUser"; | 40 const char kKeyDesktopUser[] = "isDesktopUser"; |
41 const char kKeySignedIn[] = "signedIn"; | 41 const char kKeySignedIn[] = "signedIn"; |
42 const char kKeyCanRemove[] = "canRemove"; | 42 const char kKeyCanRemove[] = "canRemove"; |
43 const char kKeyIsOwner[] = "isOwner"; | 43 const char kKeyIsOwner[] = "isOwner"; |
44 const char kKeyInitialAuthType[] = "initialAuthType"; | 44 const char kKeyInitialAuthType[] = "initialAuthType"; |
45 const char kKeyMultiProfilesAllowed[] = "isMultiProfilesAllowed"; | 45 const char kKeyMultiProfilesAllowed[] = "isMultiProfilesAllowed"; |
46 const char kKeyMultiProfilesPolicy[] = "multiProfilesPolicy"; | 46 const char kKeyMultiProfilesPolicy[] = "multiProfilesPolicy"; |
47 const char kKeyInitialLocales[] = "initialLocales"; | 47 const char kKeyInitialLocales[] = "initialLocales"; |
48 const char kKeyInitialLocale[] = "initialLocale"; | 48 const char kKeyInitialLocale[] = "initialLocale"; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 void UserSelectionScreen::FillUserDictionary( | 134 void UserSelectionScreen::FillUserDictionary( |
135 user_manager::User* user, | 135 user_manager::User* user, |
136 bool is_owner, | 136 bool is_owner, |
137 bool is_signin_to_add, | 137 bool is_signin_to_add, |
138 ScreenlockBridge::LockHandler::AuthType auth_type, | 138 ScreenlockBridge::LockHandler::AuthType auth_type, |
139 const std::vector<std::string>* public_session_recommended_locales, | 139 const std::vector<std::string>* public_session_recommended_locales, |
140 base::DictionaryValue* user_dict) { | 140 base::DictionaryValue* user_dict) { |
141 const std::string& user_id = user->email(); | 141 const std::string& user_id = user->email(); |
142 const bool is_public_session = | 142 const bool is_public_session = |
143 user->GetType() == user_manager::USER_TYPE_PUBLIC_ACCOUNT; | 143 user->GetType() == user_manager::USER_TYPE_PUBLIC_ACCOUNT; |
144 const bool is_supervised_user = | 144 const bool is_legacy_supervised_user = |
145 user->GetType() == user_manager::USER_TYPE_SUPERVISED; | 145 user->GetType() == user_manager::USER_TYPE_SUPERVISED; |
146 const bool is_child_user = user->GetType() == user_manager::USER_TYPE_CHILD; | 146 const bool is_child_user = user->GetType() == user_manager::USER_TYPE_CHILD; |
147 | 147 |
148 user_dict->SetString(kKeyUsername, user_id); | 148 user_dict->SetString(kKeyUsername, user_id); |
149 user_dict->SetString(kKeyEmailAddress, user->display_email()); | 149 user_dict->SetString(kKeyEmailAddress, user->display_email()); |
150 user_dict->SetString(kKeyDisplayName, user->GetDisplayName()); | 150 user_dict->SetString(kKeyDisplayName, user->GetDisplayName()); |
151 user_dict->SetBoolean(kKeyPublicAccount, is_public_session); | 151 user_dict->SetBoolean(kKeyPublicAccount, is_public_session); |
152 user_dict->SetBoolean(kKeySupervisedUser, is_supervised_user); | 152 user_dict->SetBoolean(kKeyLegacySupervisedUser, is_legacy_supervised_user); |
153 user_dict->SetBoolean(kKeyChildUser, is_child_user); | 153 user_dict->SetBoolean(kKeyChildUser, is_child_user); |
154 user_dict->SetBoolean(kKeyDesktopUser, false); | 154 user_dict->SetBoolean(kKeyDesktopUser, false); |
155 user_dict->SetInteger(kKeyInitialAuthType, auth_type); | 155 user_dict->SetInteger(kKeyInitialAuthType, auth_type); |
156 user_dict->SetBoolean(kKeySignedIn, user->is_logged_in()); | 156 user_dict->SetBoolean(kKeySignedIn, user->is_logged_in()); |
157 user_dict->SetBoolean(kKeyIsOwner, is_owner); | 157 user_dict->SetBoolean(kKeyIsOwner, is_owner); |
158 | 158 |
159 // Fill in multi-profiles related fields. | 159 // Fill in multi-profiles related fields. |
160 if (is_signin_to_add) { | 160 if (is_signin_to_add) { |
161 MultiProfileUserController* multi_profile_user_controller = | 161 MultiProfileUserController* multi_profile_user_controller = |
162 ChromeUserManager::Get()->GetMultiProfileUserController(); | 162 ChromeUserManager::Get()->GetMultiProfileUserController(); |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 // The user profile should exists if and only if this is lock screen. | 490 // The user profile should exists if and only if this is lock screen. |
491 DCHECK_NE(!profile, !ScreenLocker::default_screen_locker()); | 491 DCHECK_NE(!profile, !ScreenLocker::default_screen_locker()); |
492 | 492 |
493 if (!profile) | 493 if (!profile) |
494 profile = profile_helper->GetSigninProfile(); | 494 profile = profile_helper->GetSigninProfile(); |
495 | 495 |
496 return EasyUnlockService::Get(profile); | 496 return EasyUnlockService::Get(profile); |
497 } | 497 } |
498 | 498 |
499 } // namespace chromeos | 499 } // namespace chromeos |
OLD | NEW |