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 18 matching lines...) Expand all Loading... |
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 kKeySupervisedUser[] = "supervisedUser"; |
| 39 const char kKeyChildUser[] = "childUser"; |
39 const char kKeySignedIn[] = "signedIn"; | 40 const char kKeySignedIn[] = "signedIn"; |
40 const char kKeyCanRemove[] = "canRemove"; | 41 const char kKeyCanRemove[] = "canRemove"; |
41 const char kKeyIsOwner[] = "isOwner"; | 42 const char kKeyIsOwner[] = "isOwner"; |
42 const char kKeyInitialAuthType[] = "initialAuthType"; | 43 const char kKeyInitialAuthType[] = "initialAuthType"; |
43 const char kKeyMultiProfilesAllowed[] = "isMultiProfilesAllowed"; | 44 const char kKeyMultiProfilesAllowed[] = "isMultiProfilesAllowed"; |
44 const char kKeyMultiProfilesPolicy[] = "multiProfilesPolicy"; | 45 const char kKeyMultiProfilesPolicy[] = "multiProfilesPolicy"; |
45 const char kKeyInitialLocales[] = "initialLocales"; | 46 const char kKeyInitialLocales[] = "initialLocales"; |
46 const char kKeyInitialLocale[] = "initialLocale"; | 47 const char kKeyInitialLocale[] = "initialLocale"; |
47 const char kKeyInitialMultipleRecommendedLocales[] = | 48 const char kKeyInitialMultipleRecommendedLocales[] = |
48 "initialMultipleRecommendedLocales"; | 49 "initialMultipleRecommendedLocales"; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 bool is_owner, | 135 bool is_owner, |
135 bool is_signin_to_add, | 136 bool is_signin_to_add, |
136 ScreenlockBridge::LockHandler::AuthType auth_type, | 137 ScreenlockBridge::LockHandler::AuthType auth_type, |
137 const std::vector<std::string>* public_session_recommended_locales, | 138 const std::vector<std::string>* public_session_recommended_locales, |
138 base::DictionaryValue* user_dict) { | 139 base::DictionaryValue* user_dict) { |
139 const std::string& user_id = user->email(); | 140 const std::string& user_id = user->email(); |
140 const bool is_public_session = | 141 const bool is_public_session = |
141 user->GetType() == user_manager::USER_TYPE_PUBLIC_ACCOUNT; | 142 user->GetType() == user_manager::USER_TYPE_PUBLIC_ACCOUNT; |
142 const bool is_supervised_user = | 143 const bool is_supervised_user = |
143 user->GetType() == user_manager::USER_TYPE_SUPERVISED; | 144 user->GetType() == user_manager::USER_TYPE_SUPERVISED; |
| 145 const bool is_child_user = user->GetType() == user_manager::USER_TYPE_CHILD; |
144 | 146 |
145 user_dict->SetString(kKeyUsername, user_id); | 147 user_dict->SetString(kKeyUsername, user_id); |
146 user_dict->SetString(kKeyEmailAddress, user->display_email()); | 148 user_dict->SetString(kKeyEmailAddress, user->display_email()); |
147 user_dict->SetString(kKeyDisplayName, user->GetDisplayName()); | 149 user_dict->SetString(kKeyDisplayName, user->GetDisplayName()); |
148 user_dict->SetBoolean(kKeyPublicAccount, is_public_session); | 150 user_dict->SetBoolean(kKeyPublicAccount, is_public_session); |
149 user_dict->SetBoolean(kKeySupervisedUser, is_supervised_user); | 151 user_dict->SetBoolean(kKeySupervisedUser, is_supervised_user); |
| 152 user_dict->SetBoolean(kKeyChildUser, is_child_user); |
150 user_dict->SetInteger(kKeyInitialAuthType, auth_type); | 153 user_dict->SetInteger(kKeyInitialAuthType, auth_type); |
151 user_dict->SetBoolean(kKeySignedIn, user->is_logged_in()); | 154 user_dict->SetBoolean(kKeySignedIn, user->is_logged_in()); |
152 user_dict->SetBoolean(kKeyIsOwner, is_owner); | 155 user_dict->SetBoolean(kKeyIsOwner, is_owner); |
153 | 156 |
154 // Fill in multi-profiles related fields. | 157 // Fill in multi-profiles related fields. |
155 if (is_signin_to_add) { | 158 if (is_signin_to_add) { |
156 MultiProfileUserController* multi_profile_user_controller = | 159 MultiProfileUserController* multi_profile_user_controller = |
157 ChromeUserManager::Get()->GetMultiProfileUserController(); | 160 ChromeUserManager::Get()->GetMultiProfileUserController(); |
158 MultiProfileUserController::UserAllowedInSessionReason isUserAllowedReason; | 161 MultiProfileUserController::UserAllowedInSessionReason isUserAllowedReason; |
159 bool isUserAllowed = multi_profile_user_controller->IsUserAllowedInSession( | 162 bool isUserAllowed = multi_profile_user_controller->IsUserAllowedInSession( |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 // The user profile should exists if and only if this is lock screen. | 488 // The user profile should exists if and only if this is lock screen. |
486 DCHECK_NE(!profile, !ScreenLocker::default_screen_locker()); | 489 DCHECK_NE(!profile, !ScreenLocker::default_screen_locker()); |
487 | 490 |
488 if (!profile) | 491 if (!profile) |
489 profile = profile_helper->GetSigninProfile(); | 492 profile = profile_helper->GetSigninProfile(); |
490 | 493 |
491 return EasyUnlockService::Get(profile); | 494 return EasyUnlockService::Get(profile); |
492 } | 495 } |
493 | 496 |
494 } // namespace chromeos | 497 } // namespace chromeos |
OLD | NEW |