| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "base/version.h" | 21 #include "base/version.h" |
| 22 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
| 23 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 23 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
| 24 #include "chrome/browser/chromeos/boot_times_loader.h" | 24 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 25 #include "chrome/browser/chromeos/cros/cros_library.h" | 25 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 26 #include "chrome/browser/chromeos/customization_document.h" | 26 #include "chrome/browser/chromeos/customization_document.h" |
| 27 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | 27 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" |
| 28 #include "chrome/browser/chromeos/login/helper.h" | 28 #include "chrome/browser/chromeos/login/helper.h" |
| 29 #include "chrome/browser/chromeos/login/login_display_host.h" | 29 #include "chrome/browser/chromeos/login/login_display_host.h" |
| 30 #include "chrome/browser/chromeos/login/login_utils.h" | 30 #include "chrome/browser/chromeos/login/login_utils.h" |
| 31 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 31 #include "chrome/browser/chromeos/login/user_manager.h" | 32 #include "chrome/browser/chromeos/login/user_manager.h" |
| 32 #include "chrome/browser/chromeos/login/wizard_controller.h" | 33 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 33 #include "chrome/browser/chromeos/net/connectivity_state_helper.h" | 34 #include "chrome/browser/chromeos/net/connectivity_state_helper.h" |
| 34 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 35 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 35 #include "chrome/browser/chromeos/settings/cros_settings.h" | 36 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 36 #include "chrome/browser/chromeos/settings/cros_settings_names.h" | 37 #include "chrome/browser/chromeos/settings/cros_settings_names.h" |
| 37 #include "chrome/browser/chromeos/system/statistics_provider.h" | 38 #include "chrome/browser/chromeos/system/statistics_provider.h" |
| 38 #include "chrome/browser/google/google_util.h" | 39 #include "chrome/browser/google/google_util.h" |
| 39 #include "chrome/browser/policy/policy_service.h" | 40 #include "chrome/browser/policy/policy_service.h" |
| 40 #include "chrome/browser/prefs/session_startup_pref.h" | 41 #include "chrome/browser/prefs/session_startup_pref.h" |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 InitializeStartUrls(); | 778 InitializeStartUrls(); |
| 778 #ifndef NDEBUG | 779 #ifndef NDEBUG |
| 779 if (CommandLine::ForCurrentProcess()->HasSwitch( | 780 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 780 switches::kOobeSkipPostLogin)) { | 781 switches::kOobeSkipPostLogin)) { |
| 781 LoginUtils::Get()->DoBrowserLaunch(profile, host_); | 782 LoginUtils::Get()->DoBrowserLaunch(profile, host_); |
| 782 host_ = NULL; | 783 host_ = NULL; |
| 783 } else { | 784 } else { |
| 784 #endif | 785 #endif |
| 785 // Mark the device as registered., i.e. the second part of OOBE as | 786 // Mark the device as registered., i.e. the second part of OOBE as |
| 786 // completed. | 787 // completed. |
| 787 if (!WizardController::IsDeviceRegistered()) | 788 if (!StartupUtils::IsDeviceRegistered()) |
| 788 WizardController::MarkDeviceRegistered(); | 789 StartupUtils::MarkDeviceRegistered(); |
| 789 | 790 |
| 790 ActivateWizard(WizardController::kTermsOfServiceScreenName); | 791 ActivateWizard(WizardController::kTermsOfServiceScreenName); |
| 791 #ifndef NDEBUG | 792 #ifndef NDEBUG |
| 792 } | 793 } |
| 793 #endif | 794 #endif |
| 794 } else { | 795 } else { |
| 795 LoginUtils::Get()->DoBrowserLaunch(profile, host_); | 796 LoginUtils::Get()->DoBrowserLaunch(profile, host_); |
| 796 host_ = NULL; | 797 host_ = NULL; |
| 797 } | 798 } |
| 798 // Inform |login_status_consumer_| about successful login. Set most | 799 // Inform |login_status_consumer_| about successful login. Set most |
| 799 // parameters to empty since they're not needed. | 800 // parameters to empty since they're not needed. |
| 800 if (login_status_consumer_) { | 801 if (login_status_consumer_) { |
| 801 login_status_consumer_->OnLoginSuccess(UserContext(), | 802 login_status_consumer_->OnLoginSuccess(UserContext(), |
| 802 false, // pending_requests | 803 false, // pending_requests |
| 803 false); // using_oauth | 804 false); // using_oauth |
| 804 } | 805 } |
| 805 login_display_->OnFadeOut(); | 806 login_display_->OnFadeOut(); |
| 806 } | 807 } |
| 807 | 808 |
| 808 void ExistingUserController::OnOffTheRecordLoginSuccess() { | 809 void ExistingUserController::OnOffTheRecordLoginSuccess() { |
| 809 is_login_in_progress_ = false; | 810 is_login_in_progress_ = false; |
| 810 offline_failed_ = false; | 811 offline_failed_ = false; |
| 811 | 812 |
| 812 // Mark the device as registered., i.e. the second part of OOBE as completed. | 813 // Mark the device as registered., i.e. the second part of OOBE as completed. |
| 813 if (!WizardController::IsDeviceRegistered()) | 814 if (!StartupUtils::IsDeviceRegistered()) |
| 814 WizardController::MarkDeviceRegistered(); | 815 StartupUtils::MarkDeviceRegistered(); |
| 815 | 816 |
| 816 LoginUtils::Get()->CompleteOffTheRecordLogin(guest_mode_url_); | 817 LoginUtils::Get()->CompleteOffTheRecordLogin(guest_mode_url_); |
| 817 | 818 |
| 818 if (login_status_consumer_) | 819 if (login_status_consumer_) |
| 819 login_status_consumer_->OnOffTheRecordLoginSuccess(); | 820 login_status_consumer_->OnOffTheRecordLoginSuccess(); |
| 820 } | 821 } |
| 821 | 822 |
| 822 void ExistingUserController::OnPasswordChangeDetected() { | 823 void ExistingUserController::OnPasswordChangeDetected() { |
| 823 // Must not proceed without signature verification. | 824 // Must not proceed without signature verification. |
| 824 if (CrosSettingsProvider::TRUSTED != cros_settings_->PrepareTrustedValues( | 825 if (CrosSettingsProvider::TRUSTED != cros_settings_->PrepareTrustedValues( |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 // changed. | 1095 // changed. |
| 1095 UserManager::Get()->SaveUserOAuthStatus( | 1096 UserManager::Get()->SaveUserOAuthStatus( |
| 1096 username, | 1097 username, |
| 1097 User::OAUTH2_TOKEN_STATUS_INVALID); | 1098 User::OAUTH2_TOKEN_STATUS_INVALID); |
| 1098 | 1099 |
| 1099 login_display_->SetUIEnabled(true); | 1100 login_display_->SetUIEnabled(true); |
| 1100 login_display_->ShowGaiaPasswordChanged(username); | 1101 login_display_->ShowGaiaPasswordChanged(username); |
| 1101 } | 1102 } |
| 1102 | 1103 |
| 1103 } // namespace chromeos | 1104 } // namespace chromeos |
| OLD | NEW |