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