OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/existing_user_controller.h" | 5 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 void ExistingUserController::UpdateLoginDisplay( | 227 void ExistingUserController::UpdateLoginDisplay( |
228 const user_manager::UserList& users) { | 228 const user_manager::UserList& users) { |
229 bool show_users_on_signin; | 229 bool show_users_on_signin; |
230 user_manager::UserList filtered_users; | 230 user_manager::UserList filtered_users; |
231 | 231 |
232 cros_settings_->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, | 232 cros_settings_->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, |
233 &show_users_on_signin); | 233 &show_users_on_signin); |
234 for (auto* user : users) { | 234 for (auto* user : users) { |
235 // Skip kiosk apps for login screen user list. Kiosk apps as pods (aka new | 235 // Skip kiosk apps for login screen user list. Kiosk apps as pods (aka new |
236 // kiosk UI) is currently disabled and it gets the apps directly from | 236 // kiosk UI) is currently disabled and it gets the apps directly from |
237 // KioskAppManager. | 237 // KioskAppManager and ArcKioskAppManager. |
238 if (user->GetType() == user_manager::USER_TYPE_KIOSK_APP) | 238 if (user->GetType() == user_manager::USER_TYPE_KIOSK_APP || |
| 239 user->GetType() == user_manager::USER_TYPE_ARC_KIOSK_APP) { |
239 continue; | 240 continue; |
| 241 } |
240 | 242 |
241 // TODO(xiyuan): Clean user profile whose email is not in whitelist. | 243 // TODO(xiyuan): Clean user profile whose email is not in whitelist. |
242 const bool meets_supervised_requirements = | 244 const bool meets_supervised_requirements = |
243 user->GetType() != user_manager::USER_TYPE_SUPERVISED || | 245 user->GetType() != user_manager::USER_TYPE_SUPERVISED || |
244 user_manager::UserManager::Get()->AreSupervisedUsersAllowed(); | 246 user_manager::UserManager::Get()->AreSupervisedUsersAllowed(); |
245 const bool meets_whitelist_requirements = | 247 const bool meets_whitelist_requirements = |
246 CrosSettings::IsWhitelisted(user->GetAccountId().GetUserEmail(), | 248 CrosSettings::IsWhitelisted(user->GetAccountId().GetUserEmail(), |
247 nullptr) || | 249 nullptr) || |
248 !user->HasGaiaAccount(); | 250 !user->HasGaiaAccount(); |
249 | 251 |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 // Login can continue immediately. | 901 // Login can continue immediately. |
900 LoginAsPublicSessionInternal(new_user_context); | 902 LoginAsPublicSessionInternal(new_user_context); |
901 } | 903 } |
902 | 904 |
903 void ExistingUserController::LoginAsKioskApp(const std::string& app_id, | 905 void ExistingUserController::LoginAsKioskApp(const std::string& app_id, |
904 bool diagnostic_mode) { | 906 bool diagnostic_mode) { |
905 const bool auto_start = false; | 907 const bool auto_start = false; |
906 host_->StartAppLaunch(app_id, diagnostic_mode, auto_start); | 908 host_->StartAppLaunch(app_id, diagnostic_mode, auto_start); |
907 } | 909 } |
908 | 910 |
| 911 void ExistingUserController::LoginAsArcKioskApp(const AccountId& account_id) { |
| 912 login_performer_.reset(nullptr); |
| 913 login_performer_.reset(new ChromeLoginPerformer(this)); |
| 914 login_performer_->LoginAsArcKioskAccount(account_id); |
| 915 } |
| 916 |
909 void ExistingUserController::ConfigurePublicSessionAutoLogin() { | 917 void ExistingUserController::ConfigurePublicSessionAutoLogin() { |
910 std::string auto_login_account_id; | 918 std::string auto_login_account_id; |
911 cros_settings_->GetString(kAccountsPrefDeviceLocalAccountAutoLoginId, | 919 cros_settings_->GetString(kAccountsPrefDeviceLocalAccountAutoLoginId, |
912 &auto_login_account_id); | 920 &auto_login_account_id); |
913 const std::vector<policy::DeviceLocalAccount> device_local_accounts = | 921 const std::vector<policy::DeviceLocalAccount> device_local_accounts = |
914 policy::GetDeviceLocalAccounts(cros_settings_); | 922 policy::GetDeviceLocalAccounts(cros_settings_); |
915 | 923 |
916 public_session_auto_login_account_id_ = EmptyAccountId(); | 924 public_session_auto_login_account_id_ = EmptyAccountId(); |
917 for (std::vector<policy::DeviceLocalAccount>::const_iterator | 925 for (std::vector<policy::DeviceLocalAccount>::const_iterator |
918 it = device_local_accounts.begin(); | 926 it = device_local_accounts.begin(); |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 LoginAsPublicSession(user_context); | 1206 LoginAsPublicSession(user_context); |
1199 return; | 1207 return; |
1200 } | 1208 } |
1201 | 1209 |
1202 if (user_context.GetUserType() == user_manager::USER_TYPE_KIOSK_APP) { | 1210 if (user_context.GetUserType() == user_manager::USER_TYPE_KIOSK_APP) { |
1203 LoginAsKioskApp(user_context.GetAccountId().GetUserEmail(), | 1211 LoginAsKioskApp(user_context.GetAccountId().GetUserEmail(), |
1204 specifics.kiosk_diagnostic_mode); | 1212 specifics.kiosk_diagnostic_mode); |
1205 return; | 1213 return; |
1206 } | 1214 } |
1207 | 1215 |
| 1216 if (user_context.GetUserType() == user_manager::USER_TYPE_ARC_KIOSK_APP) { |
| 1217 LoginAsArcKioskApp(user_context.GetAccountId()); |
| 1218 return; |
| 1219 } |
| 1220 |
1208 // Regular user or supervised user login. | 1221 // Regular user or supervised user login. |
1209 | 1222 |
1210 if (!user_context.HasCredentials()) { | 1223 if (!user_context.HasCredentials()) { |
1211 // If credentials are missing, refuse to log in. | 1224 // If credentials are missing, refuse to log in. |
1212 | 1225 |
1213 // Reenable clicking on other windows and status area. | 1226 // Reenable clicking on other windows and status area. |
1214 login_display_->SetUIEnabled(true); | 1227 login_display_->SetUIEnabled(true); |
1215 // Restart the auto-login timer. | 1228 // Restart the auto-login timer. |
1216 StartPublicSessionAutoLoginTimer(); | 1229 StartPublicSessionAutoLoginTimer(); |
1217 } | 1230 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 } | 1277 } |
1265 | 1278 |
1266 // Otherwise, show the unrecoverable cryptohome error UI and ask user's | 1279 // Otherwise, show the unrecoverable cryptohome error UI and ask user's |
1267 // permission to collect a feedback. | 1280 // permission to collect a feedback. |
1268 RecordPasswordChangeFlow(LOGIN_PASSWORD_CHANGE_FLOW_CRYPTOHOME_FAILURE); | 1281 RecordPasswordChangeFlow(LOGIN_PASSWORD_CHANGE_FLOW_CRYPTOHOME_FAILURE); |
1269 VLOG(1) << "Show unrecoverable cryptohome error dialog."; | 1282 VLOG(1) << "Show unrecoverable cryptohome error dialog."; |
1270 login_display_->ShowUnrecoverableCrypthomeErrorDialog(); | 1283 login_display_->ShowUnrecoverableCrypthomeErrorDialog(); |
1271 } | 1284 } |
1272 | 1285 |
1273 } // namespace chromeos | 1286 } // namespace chromeos |
OLD | NEW |