| 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 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1231 bool start_auto_login_timer) { | 1231 bool start_auto_login_timer) { |
| 1232 is_login_in_progress_ = false; | 1232 is_login_in_progress_ = false; |
| 1233 | 1233 |
| 1234 // Reenable clicking on other windows and status area. | 1234 // Reenable clicking on other windows and status area. |
| 1235 login_display_->SetUIEnabled(true); | 1235 login_display_->SetUIEnabled(true); |
| 1236 | 1236 |
| 1237 if (start_auto_login_timer) | 1237 if (start_auto_login_timer) |
| 1238 StartAutoLoginTimer(); | 1238 StartAutoLoginTimer(); |
| 1239 } | 1239 } |
| 1240 | 1240 |
| 1241 void ExistingUserController::ContinueLoginWhenCryptohomeAvailable( |
| 1242 base::OnceClosure continuation, |
| 1243 bool service_is_available) { |
| 1244 if (!service_is_available) { |
| 1245 LOG(ERROR) << "Cryptohome service is not available"; |
| 1246 OnAuthFailure(AuthFailure(AuthFailure::COULD_NOT_MOUNT_CRYPTOHOME)); |
| 1247 return; |
| 1248 } |
| 1249 std::move(continuation).Run(); |
| 1250 } |
| 1251 |
| 1241 void ExistingUserController::ContinueLoginIfDeviceNotDisabled( | 1252 void ExistingUserController::ContinueLoginIfDeviceNotDisabled( |
| 1242 const base::Closure& continuation) { | 1253 const base::Closure& continuation) { |
| 1243 // Disable clicking on other windows and status tray. | 1254 // Disable clicking on other windows and status tray. |
| 1244 login_display_->SetUIEnabled(false); | 1255 login_display_->SetUIEnabled(false); |
| 1245 | 1256 |
| 1246 // Stop the auto-login timer. | 1257 // Stop the auto-login timer. |
| 1247 StopAutoLoginTimer(); | 1258 StopAutoLoginTimer(); |
| 1248 | 1259 |
| 1249 // Wait for the |cros_settings_| to become either trusted or permanently | 1260 // Wait for the |cros_settings_| to become either trusted or permanently |
| 1250 // untrusted. | 1261 // untrusted. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1276 HonorDeviceDisablingDuringNormalOperation()) { | 1287 HonorDeviceDisablingDuringNormalOperation()) { |
| 1277 // If the device is disabled, bail out. A device disabled screen will be | 1288 // If the device is disabled, bail out. A device disabled screen will be |
| 1278 // shown by the DeviceDisablingManager. | 1289 // shown by the DeviceDisablingManager. |
| 1279 | 1290 |
| 1280 // Re-enable clicking on other windows and the status area. Do not start the | 1291 // Re-enable clicking on other windows and the status area. Do not start the |
| 1281 // auto-login timer though. On a disabled device, no auto-login can succeed. | 1292 // auto-login timer though. On a disabled device, no auto-login can succeed. |
| 1282 login_display_->SetUIEnabled(true); | 1293 login_display_->SetUIEnabled(true); |
| 1283 return; | 1294 return; |
| 1284 } | 1295 } |
| 1285 | 1296 |
| 1286 continuation.Run(); | 1297 chromeos::DBusThreadManager::Get() |
| 1298 ->GetCryptohomeClient() |
| 1299 ->WaitForServiceToBeAvailable(base::Bind( |
| 1300 &ExistingUserController::ContinueLoginWhenCryptohomeAvailable, |
| 1301 weak_factory_.GetWeakPtr(), continuation)); |
| 1287 } | 1302 } |
| 1288 | 1303 |
| 1289 void ExistingUserController::DoCompleteLogin( | 1304 void ExistingUserController::DoCompleteLogin( |
| 1290 const UserContext& user_context_wo_device_id) { | 1305 const UserContext& user_context_wo_device_id) { |
| 1291 UserContext user_context = user_context_wo_device_id; | 1306 UserContext user_context = user_context_wo_device_id; |
| 1292 std::string device_id = | 1307 std::string device_id = |
| 1293 user_manager::known_user::GetDeviceId(user_context.GetAccountId()); | 1308 user_manager::known_user::GetDeviceId(user_context.GetAccountId()); |
| 1294 if (device_id.empty()) { | 1309 if (device_id.empty()) { |
| 1295 bool is_ephemeral = ChromeUserManager::Get()->AreEphemeralUsersEnabled() && | 1310 bool is_ephemeral = ChromeUserManager::Get()->AreEphemeralUsersEnabled() && |
| 1296 user_context.GetAccountId() != | 1311 user_context.GetAccountId() != |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1435 login_display_->ShowUnrecoverableCrypthomeErrorDialog(); | 1450 login_display_->ShowUnrecoverableCrypthomeErrorDialog(); |
| 1436 } | 1451 } |
| 1437 | 1452 |
| 1438 void ExistingUserController::ClearRecordedNames() { | 1453 void ExistingUserController::ClearRecordedNames() { |
| 1439 display_email_.clear(); | 1454 display_email_.clear(); |
| 1440 display_name_.clear(); | 1455 display_name_.clear(); |
| 1441 given_name_.clear(); | 1456 given_name_.clear(); |
| 1442 } | 1457 } |
| 1443 | 1458 |
| 1444 } // namespace chromeos | 1459 } // namespace chromeos |
| OLD | NEW |