| 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/login_performer.h" | 5 #include "chrome/browser/chromeos/login/login_performer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 14 #include "base/threading/thread_restrictions.h" |
| 14 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 15 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
| 16 #include "chrome/browser/chromeos/boot_times_loader.h" | 17 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 17 #include "chrome/browser/chromeos/cros_settings.h" | 18 #include "chrome/browser/chromeos/cros_settings.h" |
| 18 #include "chrome/browser/chromeos/cros_settings_names.h" | 19 #include "chrome/browser/chromeos/cros_settings_names.h" |
| 19 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | 20 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
| 20 #include "chrome/browser/chromeos/dbus/power_manager_client.h" | 21 #include "chrome/browser/chromeos/dbus/power_manager_client.h" |
| 21 #include "chrome/browser/chromeos/login/login_utils.h" | 22 #include "chrome/browser/chromeos/login/login_utils.h" |
| 22 #include "chrome/browser/chromeos/login/screen_locker.h" | 23 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 23 #include "chrome/browser/prefs/pref_service.h" | 24 #include "chrome/browser/prefs/pref_service.h" |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 case GoogleServiceAuthError::CAPTCHA_REQUIRED: | 412 case GoogleServiceAuthError::CAPTCHA_REQUIRED: |
| 412 default: | 413 default: |
| 413 // Unless there's new GoogleServiceAuthErrors state has been added. | 414 // Unless there's new GoogleServiceAuthErrors state has been added. |
| 414 NOTREACHED(); | 415 NOTREACHED(); |
| 415 return; | 416 return; |
| 416 } | 417 } |
| 417 } | 418 } |
| 418 | 419 |
| 419 void LoginPerformer::ResolveLockLoginFailure() { | 420 void LoginPerformer::ResolveLockLoginFailure() { |
| 420 if (last_login_failure_.reason() == LoginFailure::LOGIN_TIMED_OUT) { | 421 if (last_login_failure_.reason() == LoginFailure::LOGIN_TIMED_OUT) { |
| 421 LOG(WARNING) << "Online login timed out - unlocking screen. " | 422 LOG(WARNING) << "Online login timed out - unlocking screen. " |
| 422 << "Granting user access based on offline auth only."; | 423 << "Granting user access based on offline auth only."; |
| 423 RequestScreenUnlock(); | 424 RequestScreenUnlock(); |
| 424 return; | 425 return; |
| 425 } else if (last_login_failure_.reason() == | 426 } else if (last_login_failure_.reason() == |
| 426 LoginFailure::NETWORK_AUTH_FAILED) { | 427 LoginFailure::NETWORK_AUTH_FAILED) { |
| 427 ResolveLockNetworkAuthFailure(); | 428 ResolveLockNetworkAuthFailure(); |
| 428 return; | 429 return; |
| 429 } else if (last_login_failure_.reason() == | 430 } else if (last_login_failure_.reason() == |
| 430 LoginFailure::COULD_NOT_MOUNT_CRYPTOHOME || | 431 LoginFailure::COULD_NOT_MOUNT_CRYPTOHOME || |
| 431 last_login_failure_.reason() == | 432 last_login_failure_.reason() == |
| 432 LoginFailure::DATA_REMOVAL_FAILED) { | 433 LoginFailure::DATA_REMOVAL_FAILED) { |
| 433 LOG(ERROR) << "Cryptohome error, forcing sign out."; | 434 LOG(ERROR) << "Cryptohome error, forcing sign out."; |
| 434 } else { | 435 } else { |
| 435 // COULD_NOT_MOUNT_TMPFS, UNLOCK_FAILED should not happen here. | 436 // COULD_NOT_MOUNT_TMPFS, UNLOCK_FAILED should not happen here. |
| 436 NOTREACHED(); | 437 NOTREACHED(); |
| 437 } | 438 } |
| 438 ScreenLocker::default_screen_locker()->Signout(); | 439 ScreenLocker::default_screen_locker()->Signout(); |
| 439 } | 440 } |
| 440 | 441 |
| 441 void LoginPerformer::ResolveLockNetworkAuthFailure() { | 442 void LoginPerformer::ResolveLockNetworkAuthFailure() { |
| 442 DCHECK(ScreenLocker::default_screen_locker()) | 443 DCHECK(ScreenLocker::default_screen_locker()) |
| 443 << "ScreenLocker instance doesn't exist."; | 444 << "ScreenLocker instance doesn't exist."; |
| 444 DCHECK(last_login_failure_.reason() == LoginFailure::NETWORK_AUTH_FAILED); | 445 DCHECK(last_login_failure_.reason() == LoginFailure::NETWORK_AUTH_FAILED); |
| 445 | 446 |
| 446 int msg_id = IDS_LOGIN_ERROR_AUTHENTICATING; | 447 int msg_id = IDS_LOGIN_ERROR_AUTHENTICATING; |
| 447 HelpAppLauncher::HelpTopic help_topic = | 448 HelpAppLauncher::HelpTopic help_topic = |
| 448 HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT; | 449 HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 profile, | 551 profile, |
| 551 username_, | 552 username_, |
| 552 password_, | 553 password_, |
| 553 std::string(), | 554 std::string(), |
| 554 std::string())); | 555 std::string())); |
| 555 } | 556 } |
| 556 password_.clear(); | 557 password_.clear(); |
| 557 } | 558 } |
| 558 | 559 |
| 559 } // namespace chromeos | 560 } // namespace chromeos |
| OLD | NEW |