OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 283 |
284 void ExistingUserController::OnLoginFailure(const LoginFailure& failure) { | 284 void ExistingUserController::OnLoginFailure(const LoginFailure& failure) { |
285 guest_mode_url_ = GURL::EmptyGURL(); | 285 guest_mode_url_ = GURL::EmptyGURL(); |
286 std::string error = failure.GetErrorString(); | 286 std::string error = failure.GetErrorString(); |
287 | 287 |
288 // Check networking after trying to login in case user is | 288 // Check networking after trying to login in case user is |
289 // cached locally or the local admin account. | 289 // cached locally or the local admin account. |
290 bool is_known_user = | 290 bool is_known_user = |
291 UserManager::Get()->IsKnownUser(last_login_attempt_username_); | 291 UserManager::Get()->IsKnownUser(last_login_attempt_username_); |
292 NetworkLibrary* network = CrosLibrary::Get()->GetNetworkLibrary(); | 292 NetworkLibrary* network = CrosLibrary::Get()->GetNetworkLibrary(); |
293 if (!network || !CrosLibrary::Get()->EnsureLoaded()) { | 293 if (!network) { |
294 ShowError(IDS_LOGIN_ERROR_NO_NETWORK_LIBRARY, error); | 294 ShowError(IDS_LOGIN_ERROR_NO_NETWORK_LIBRARY, error); |
295 } else if (!network->Connected()) { | 295 } else if (!network->Connected()) { |
296 if (is_known_user) | 296 if (is_known_user) |
297 ShowError(IDS_LOGIN_ERROR_AUTHENTICATING, error); | 297 ShowError(IDS_LOGIN_ERROR_AUTHENTICATING, error); |
298 else | 298 else |
299 ShowError(IDS_LOGIN_ERROR_OFFLINE_FAILED_NETWORK_NOT_CONNECTED, error); | 299 ShowError(IDS_LOGIN_ERROR_OFFLINE_FAILED_NETWORK_NOT_CONNECTED, error); |
300 } else { | 300 } else { |
301 // Network is connected. | 301 // Network is connected. |
302 const Network* active_network = network->active_network(); | 302 const Network* active_network = network->active_network(); |
303 if (failure.reason() == LoginFailure::NETWORK_AUTH_FAILED && | 303 if (failure.reason() == LoginFailure::NETWORK_AUTH_FAILED && |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 | 579 |
580 void ExistingUserController::SetOwnerUserInCryptohome() { | 580 void ExistingUserController::SetOwnerUserInCryptohome() { |
581 bool trusted_owner_available = user_settings_->RequestTrustedOwner( | 581 bool trusted_owner_available = user_settings_->RequestTrustedOwner( |
582 base::Bind(&ExistingUserController::SetOwnerUserInCryptohome, | 582 base::Bind(&ExistingUserController::SetOwnerUserInCryptohome, |
583 weak_factory_.GetWeakPtr())); | 583 weak_factory_.GetWeakPtr())); |
584 if (!trusted_owner_available) { | 584 if (!trusted_owner_available) { |
585 // Value of owner email is still not verified. | 585 // Value of owner email is still not verified. |
586 // Another attempt will be invoked after verification completion. | 586 // Another attempt will be invoked after verification completion. |
587 return; | 587 return; |
588 } | 588 } |
589 if (CrosLibrary::Get()->EnsureLoaded()) { | 589 CryptohomeLibrary* cryptohomed = CrosLibrary::Get()->GetCryptohomeLibrary(); |
590 CryptohomeLibrary* cryptohomed = CrosLibrary::Get()->GetCryptohomeLibrary(); | 590 cryptohomed->AsyncSetOwnerUser( |
591 cryptohomed->AsyncSetOwnerUser( | 591 UserCrosSettingsProvider::cached_owner(), NULL); |
592 UserCrosSettingsProvider::cached_owner(), NULL); | |
593 | 592 |
594 // Do not invoke AsyncDoAutomaticFreeDiskSpaceControl(NULL) here | 593 // Do not invoke AsyncDoAutomaticFreeDiskSpaceControl(NULL) here |
595 // so it does not delay the following mount. Cleanup will be | 594 // so it does not delay the following mount. Cleanup will be |
596 // started in Cryptohomed by timer. | 595 // started in Cryptohomed by timer. |
597 } | |
598 } | 596 } |
599 | 597 |
600 } // namespace chromeos | 598 } // namespace chromeos |
OLD | NEW |