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) | |
Luis Héctor Chávez
2016/11/12 18:03:08
nit: you cannot elide braces if the condition span
Sergey Poromov
2016/11/14 17:23:23
Done.
| |
239 continue; | 240 continue; |
240 | 241 |
241 // TODO(xiyuan): Clean user profile whose email is not in whitelist. | 242 // TODO(xiyuan): Clean user profile whose email is not in whitelist. |
242 const bool meets_supervised_requirements = | 243 const bool meets_supervised_requirements = |
243 user->GetType() != user_manager::USER_TYPE_SUPERVISED || | 244 user->GetType() != user_manager::USER_TYPE_SUPERVISED || |
244 user_manager::UserManager::Get()->AreSupervisedUsersAllowed(); | 245 user_manager::UserManager::Get()->AreSupervisedUsersAllowed(); |
245 const bool meets_whitelist_requirements = | 246 const bool meets_whitelist_requirements = |
246 CrosSettings::IsWhitelisted(user->GetAccountId().GetUserEmail(), | 247 CrosSettings::IsWhitelisted(user->GetAccountId().GetUserEmail(), |
247 nullptr) || | 248 nullptr) || |
248 !user->HasGaiaAccount(); | 249 !user->HasGaiaAccount(); |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
899 // Login can continue immediately. | 900 // Login can continue immediately. |
900 LoginAsPublicSessionInternal(new_user_context); | 901 LoginAsPublicSessionInternal(new_user_context); |
901 } | 902 } |
902 | 903 |
903 void ExistingUserController::LoginAsKioskApp(const std::string& app_id, | 904 void ExistingUserController::LoginAsKioskApp(const std::string& app_id, |
904 bool diagnostic_mode) { | 905 bool diagnostic_mode) { |
905 const bool auto_start = false; | 906 const bool auto_start = false; |
906 host_->StartAppLaunch(app_id, diagnostic_mode, auto_start); | 907 host_->StartAppLaunch(app_id, diagnostic_mode, auto_start); |
907 } | 908 } |
908 | 909 |
910 void ExistingUserController::LoginAsArcKioskApp(const AccountId& account_id) { | |
911 login_performer_.reset(nullptr); | |
Luis Héctor Chávez
2016/11/12 18:03:08
nit: this is unnecessary. The call to reset() in t
Sergey Poromov
2016/11/14 17:23:22
It's destroying after creating a new ChromeLoginPe
| |
912 login_performer_.reset(new ChromeLoginPerformer(this)); | |
913 login_performer_->LoginAsArcKioskAccount(account_id); | |
914 } | |
915 | |
909 void ExistingUserController::ConfigurePublicSessionAutoLogin() { | 916 void ExistingUserController::ConfigurePublicSessionAutoLogin() { |
910 std::string auto_login_account_id; | 917 std::string auto_login_account_id; |
911 cros_settings_->GetString(kAccountsPrefDeviceLocalAccountAutoLoginId, | 918 cros_settings_->GetString(kAccountsPrefDeviceLocalAccountAutoLoginId, |
912 &auto_login_account_id); | 919 &auto_login_account_id); |
913 const std::vector<policy::DeviceLocalAccount> device_local_accounts = | 920 const std::vector<policy::DeviceLocalAccount> device_local_accounts = |
914 policy::GetDeviceLocalAccounts(cros_settings_); | 921 policy::GetDeviceLocalAccounts(cros_settings_); |
915 | 922 |
916 public_session_auto_login_account_id_ = EmptyAccountId(); | 923 public_session_auto_login_account_id_ = EmptyAccountId(); |
917 for (std::vector<policy::DeviceLocalAccount>::const_iterator | 924 for (std::vector<policy::DeviceLocalAccount>::const_iterator |
918 it = device_local_accounts.begin(); | 925 it = device_local_accounts.begin(); |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1198 LoginAsPublicSession(user_context); | 1205 LoginAsPublicSession(user_context); |
1199 return; | 1206 return; |
1200 } | 1207 } |
1201 | 1208 |
1202 if (user_context.GetUserType() == user_manager::USER_TYPE_KIOSK_APP) { | 1209 if (user_context.GetUserType() == user_manager::USER_TYPE_KIOSK_APP) { |
1203 LoginAsKioskApp(user_context.GetAccountId().GetUserEmail(), | 1210 LoginAsKioskApp(user_context.GetAccountId().GetUserEmail(), |
1204 specifics.kiosk_diagnostic_mode); | 1211 specifics.kiosk_diagnostic_mode); |
1205 return; | 1212 return; |
1206 } | 1213 } |
1207 | 1214 |
1215 if (user_context.GetUserType() == user_manager::USER_TYPE_ARC_KIOSK_APP) { | |
1216 LoginAsArcKioskApp(user_context.GetAccountId()); | |
1217 return; | |
1218 } | |
1219 | |
1208 // Regular user or supervised user login. | 1220 // Regular user or supervised user login. |
1209 | 1221 |
1210 if (!user_context.HasCredentials()) { | 1222 if (!user_context.HasCredentials()) { |
1211 // If credentials are missing, refuse to log in. | 1223 // If credentials are missing, refuse to log in. |
1212 | 1224 |
1213 // Reenable clicking on other windows and status area. | 1225 // Reenable clicking on other windows and status area. |
1214 login_display_->SetUIEnabled(true); | 1226 login_display_->SetUIEnabled(true); |
1215 // Restart the auto-login timer. | 1227 // Restart the auto-login timer. |
1216 StartPublicSessionAutoLoginTimer(); | 1228 StartPublicSessionAutoLoginTimer(); |
1217 } | 1229 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1264 } | 1276 } |
1265 | 1277 |
1266 // Otherwise, show the unrecoverable cryptohome error UI and ask user's | 1278 // Otherwise, show the unrecoverable cryptohome error UI and ask user's |
1267 // permission to collect a feedback. | 1279 // permission to collect a feedback. |
1268 RecordPasswordChangeFlow(LOGIN_PASSWORD_CHANGE_FLOW_CRYPTOHOME_FAILURE); | 1280 RecordPasswordChangeFlow(LOGIN_PASSWORD_CHANGE_FLOW_CRYPTOHOME_FAILURE); |
1269 VLOG(1) << "Show unrecoverable cryptohome error dialog."; | 1281 VLOG(1) << "Show unrecoverable cryptohome error dialog."; |
1270 login_display_->ShowUnrecoverableCrypthomeErrorDialog(); | 1282 login_display_->ShowUnrecoverableCrypthomeErrorDialog(); |
1271 } | 1283 } |
1272 | 1284 |
1273 } // namespace chromeos | 1285 } // namespace chromeos |
OLD | NEW |