| 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 void StartPublicSessionAutoLoginTimer(); | 72 void StartPublicSessionAutoLoginTimer(); |
| 73 | 73 |
| 74 // Stop the public session auto-login timer when a login attempt begins. | 74 // Stop the public session auto-login timer when a login attempt begins. |
| 75 void StopPublicSessionAutoLoginTimer(); | 75 void StopPublicSessionAutoLoginTimer(); |
| 76 | 76 |
| 77 // LoginDisplay::Delegate: implementation | 77 // LoginDisplay::Delegate: implementation |
| 78 virtual void CancelPasswordChangedFlow() OVERRIDE; | 78 virtual void CancelPasswordChangedFlow() OVERRIDE; |
| 79 virtual void CreateAccount() OVERRIDE; | 79 virtual void CreateAccount() OVERRIDE; |
| 80 virtual void CreateLocallyManagedUser(const string16& display_name, | 80 virtual void CreateLocallyManagedUser(const string16& display_name, |
| 81 const std::string& password) OVERRIDE; | 81 const std::string& password) OVERRIDE; |
| 82 virtual void CompleteLogin(const std::string& username, | 82 virtual void CompleteLogin(const UserCredentials& credentials) OVERRIDE; |
| 83 const std::string& password) OVERRIDE; | |
| 84 virtual string16 GetConnectedNetworkName() OVERRIDE; | 83 virtual string16 GetConnectedNetworkName() OVERRIDE; |
| 85 virtual void Login(const std::string& username, | 84 virtual void Login(const UserCredentials& credentials) OVERRIDE; |
| 86 const std::string& password) OVERRIDE; | |
| 87 virtual void MigrateUserData(const std::string& old_password) OVERRIDE; | 85 virtual void MigrateUserData(const std::string& old_password) OVERRIDE; |
| 88 virtual void LoginAsRetailModeUser() OVERRIDE; | 86 virtual void LoginAsRetailModeUser() OVERRIDE; |
| 89 virtual void LoginAsGuest() OVERRIDE; | 87 virtual void LoginAsGuest() OVERRIDE; |
| 90 virtual void LoginAsPublicAccount(const std::string& username) OVERRIDE; | 88 virtual void LoginAsPublicAccount(const std::string& username) OVERRIDE; |
| 91 virtual void OnSigninScreenReady() OVERRIDE; | 89 virtual void OnSigninScreenReady() OVERRIDE; |
| 92 virtual void OnUserSelected(const std::string& username) OVERRIDE; | 90 virtual void OnUserSelected(const std::string& username) OVERRIDE; |
| 93 virtual void OnStartEnterpriseEnrollment() OVERRIDE; | 91 virtual void OnStartEnterpriseEnrollment() OVERRIDE; |
| 94 virtual void OnStartDeviceReset() OVERRIDE; | 92 virtual void OnStartDeviceReset() OVERRIDE; |
| 95 virtual void ResetPublicSessionAutoLoginTimer() OVERRIDE; | 93 virtual void ResetPublicSessionAutoLoginTimer() OVERRIDE; |
| 96 virtual void ResyncUserData() OVERRIDE; | 94 virtual void ResyncUserData() OVERRIDE; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 126 |
| 129 // Retrieve public session auto-login policy and update the timer. | 127 // Retrieve public session auto-login policy and update the timer. |
| 130 void ConfigurePublicSessionAutoLogin(); | 128 void ConfigurePublicSessionAutoLogin(); |
| 131 | 129 |
| 132 // Trigger public session auto-login. | 130 // Trigger public session auto-login. |
| 133 void OnPublicSessionAutoLoginTimerFire(); | 131 void OnPublicSessionAutoLoginTimerFire(); |
| 134 | 132 |
| 135 // LoginPerformer::Delegate implementation: | 133 // LoginPerformer::Delegate implementation: |
| 136 virtual void OnLoginFailure(const LoginFailure& error) OVERRIDE; | 134 virtual void OnLoginFailure(const LoginFailure& error) OVERRIDE; |
| 137 virtual void OnLoginSuccess( | 135 virtual void OnLoginSuccess( |
| 138 const std::string& username, | 136 const UserCredentials& credentials, |
| 139 const std::string& password, | |
| 140 bool pending_requests, | 137 bool pending_requests, |
| 141 bool using_oauth) OVERRIDE; | 138 bool using_oauth) OVERRIDE; |
| 142 virtual void OnOffTheRecordLoginSuccess() OVERRIDE; | 139 virtual void OnOffTheRecordLoginSuccess() OVERRIDE; |
| 143 virtual void OnPasswordChangeDetected() OVERRIDE; | 140 virtual void OnPasswordChangeDetected() OVERRIDE; |
| 144 virtual void WhiteListCheckFailed(const std::string& email) OVERRIDE; | 141 virtual void WhiteListCheckFailed(const std::string& email) OVERRIDE; |
| 145 virtual void PolicyLoadFailed() OVERRIDE; | 142 virtual void PolicyLoadFailed() OVERRIDE; |
| 146 virtual void OnOnlineChecked( | 143 virtual void OnOnlineChecked( |
| 147 const std::string& username, bool success) OVERRIDE; | 144 const std::string& username, bool success) OVERRIDE; |
| 148 | 145 |
| 149 // LoginUtils::Delegate implementation: | 146 // LoginUtils::Delegate implementation: |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 183 |
| 187 // Shows "critical TPM error" screen and starts reboot timer. | 184 // Shows "critical TPM error" screen and starts reboot timer. |
| 188 void ShowTPMErrorAndScheduleReboot(); | 185 void ShowTPMErrorAndScheduleReboot(); |
| 189 | 186 |
| 190 // Reboot timer handler. | 187 // Reboot timer handler. |
| 191 void OnRebootTimeElapsed(); | 188 void OnRebootTimeElapsed(); |
| 192 | 189 |
| 193 // Invoked to complete login. Login might be suspended if auto-enrollment | 190 // Invoked to complete login. Login might be suspended if auto-enrollment |
| 194 // has to be performed, and will resume once auto-enrollment completes. | 191 // has to be performed, and will resume once auto-enrollment completes. |
| 195 void CompleteLoginInternal( | 192 void CompleteLoginInternal( |
| 196 const std::string& username, | 193 const UserCredentials& credentials, |
| 197 const std::string& password, | |
| 198 DeviceSettingsService::OwnershipStatus ownership_status, | 194 DeviceSettingsService::OwnershipStatus ownership_status, |
| 199 bool is_owner); | 195 bool is_owner); |
| 200 | 196 |
| 201 // Creates |login_performer_| if necessary and calls login() on it. | 197 // Creates |login_performer_| if necessary and calls login() on it. |
| 202 // The string arguments aren't passed by const reference because this is | 198 // The string arguments aren't passed by const reference because this is |
| 203 // posted as |resume_login_callback_| and resets it. | 199 // posted as |resume_login_callback_| and resets it. |
| 204 void PerformLogin(std::string username, | 200 void PerformLogin(const UserCredentials& credentials, |
| 205 std::string password, | |
| 206 LoginPerformer::AuthorizationMode auth_mode); | 201 LoginPerformer::AuthorizationMode auth_mode); |
| 207 | 202 |
| 208 void set_login_performer_delegate(LoginPerformer::Delegate* d) { | 203 void set_login_performer_delegate(LoginPerformer::Delegate* d) { |
| 209 login_performer_delegate_.reset(d); | 204 login_performer_delegate_.reset(d); |
| 210 } | 205 } |
| 211 | 206 |
| 212 // Updates the |login_display_| attached to this controller. | 207 // Updates the |login_display_| attached to this controller. |
| 213 void UpdateLoginDisplay(const UserList& users); | 208 void UpdateLoginDisplay(const UserList& users); |
| 214 | 209 |
| 215 // Public session auto-login timer. | 210 // Public session auto-login timer. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 base::OneShotTimer<ExistingUserController> reboot_timer_; | 293 base::OneShotTimer<ExistingUserController> reboot_timer_; |
| 299 | 294 |
| 300 FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerTest, ExistingUserLogin); | 295 FRIEND_TEST_ALL_PREFIXES(ExistingUserControllerTest, ExistingUserLogin); |
| 301 | 296 |
| 302 DISALLOW_COPY_AND_ASSIGN(ExistingUserController); | 297 DISALLOW_COPY_AND_ASSIGN(ExistingUserController); |
| 303 }; | 298 }; |
| 304 | 299 |
| 305 } // namespace chromeos | 300 } // namespace chromeos |
| 306 | 301 |
| 307 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ | 302 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EXISTING_USER_CONTROLLER_H_ |
| OLD | NEW |