| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROMEOS_LOGIN_AUTH_CRYPTOHOME_AUTHENTICATOR_H_ | 5 #ifndef CHROMEOS_LOGIN_AUTH_CRYPTOHOME_AUTHENTICATOR_H_ |
| 6 #define CHROMEOS_LOGIN_AUTH_CRYPTOHOME_AUTHENTICATOR_H_ | 6 #define CHROMEOS_LOGIN_AUTH_CRYPTOHOME_AUTHENTICATOR_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 PUBLIC_ACCOUNT_LOGIN = 17, // Logged into a public account. | 85 PUBLIC_ACCOUNT_LOGIN = 17, // Logged into a public account. |
| 86 SUPERVISED_USER_LOGIN = 18, // Logged in as a supervised user. | 86 SUPERVISED_USER_LOGIN = 18, // Logged in as a supervised user. |
| 87 LOGIN_FAILED = 19, // Login denied. | 87 LOGIN_FAILED = 19, // Login denied. |
| 88 OWNER_REQUIRED = 20, // Login is restricted to the owner only. | 88 OWNER_REQUIRED = 20, // Login is restricted to the owner only. |
| 89 FAILED_USERNAME_HASH = 21, // Failed GetSanitizedUsername request. | 89 FAILED_USERNAME_HASH = 21, // Failed GetSanitizedUsername request. |
| 90 KIOSK_ACCOUNT_LOGIN = 22, // Logged into a kiosk account. | 90 KIOSK_ACCOUNT_LOGIN = 22, // Logged into a kiosk account. |
| 91 REMOVED_DATA_AFTER_FAILURE = 23, // Successfully removed the user's | 91 REMOVED_DATA_AFTER_FAILURE = 23, // Successfully removed the user's |
| 92 // cryptohome after a login failure. | 92 // cryptohome after a login failure. |
| 93 FAILED_OLD_ENCRYPTION = 24, // Login failed, cryptohome is encrypted | 93 FAILED_OLD_ENCRYPTION = 24, // Login failed, cryptohome is encrypted |
| 94 // in old format. | 94 // in old format. |
| 95 FAILED_PREVIOUS_MIGRATION_INCOMPLETE = 25, // Login failed, cryptohome is |
| 96 // partially encrypted in old |
| 97 // format. |
| 95 }; | 98 }; |
| 96 | 99 |
| 97 CryptohomeAuthenticator(scoped_refptr<base::TaskRunner> task_runner, | 100 CryptohomeAuthenticator(scoped_refptr<base::TaskRunner> task_runner, |
| 98 AuthStatusConsumer* consumer); | 101 AuthStatusConsumer* consumer); |
| 99 | 102 |
| 100 // Authenticator overrides. | 103 // Authenticator overrides. |
| 101 void CompleteLogin(content::BrowserContext* context, | 104 void CompleteLogin(content::BrowserContext* context, |
| 102 const UserContext& user_context) override; | 105 const UserContext& user_context) override; |
| 103 | 106 |
| 104 // Given |user_context|, this method attempts to authenticate to your | 107 // Given |user_context|, this method attempts to authenticate to your |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 // Attempts to make a decision and call back |consumer_| based on | 161 // Attempts to make a decision and call back |consumer_| based on |
| 159 // the state we have gathered at the time of call. If a decision | 162 // the state we have gathered at the time of call. If a decision |
| 160 // can't be made, defers until the next time this is called. | 163 // can't be made, defers until the next time this is called. |
| 161 // When a decision is made, will call back to |consumer_| on the UI thread. | 164 // When a decision is made, will call back to |consumer_| on the UI thread. |
| 162 // | 165 // |
| 163 // Must be called on the UI thread. | 166 // Must be called on the UI thread. |
| 164 void Resolve() override; | 167 void Resolve() override; |
| 165 | 168 |
| 166 void OnOffTheRecordAuthSuccess(); | 169 void OnOffTheRecordAuthSuccess(); |
| 167 void OnPasswordChangeDetected(); | 170 void OnPasswordChangeDetected(); |
| 168 void OnOldEncryptionDetected(); | 171 void OnOldEncryptionDetected(bool has_incomplete_migration); |
| 169 | 172 |
| 170 protected: | 173 protected: |
| 171 ~CryptohomeAuthenticator() override; | 174 ~CryptohomeAuthenticator() override; |
| 172 | 175 |
| 173 typedef base::Callback<void(bool is_owner)> IsOwnerCallback; | 176 typedef base::Callback<void(bool is_owner)> IsOwnerCallback; |
| 174 | 177 |
| 175 // Method to be implemented in child. Return |true| if user specified in | 178 // Method to be implemented in child. Return |true| if user specified in |
| 176 // |context| exists on device. | 179 // |context| exists on device. |
| 177 virtual bool IsKnownUser(const UserContext& context) = 0; | 180 virtual bool IsKnownUser(const UserContext& context) = 0; |
| 178 | 181 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 // When |remove_user_data_on_failure_| is set, we delay calling | 274 // When |remove_user_data_on_failure_| is set, we delay calling |
| 272 // consumer_->OnAuthFailure() until we removed the user cryptohome. | 275 // consumer_->OnAuthFailure() until we removed the user cryptohome. |
| 273 const AuthFailure* delayed_login_failure_; | 276 const AuthFailure* delayed_login_failure_; |
| 274 | 277 |
| 275 DISALLOW_COPY_AND_ASSIGN(CryptohomeAuthenticator); | 278 DISALLOW_COPY_AND_ASSIGN(CryptohomeAuthenticator); |
| 276 }; | 279 }; |
| 277 | 280 |
| 278 } // namespace chromeos | 281 } // namespace chromeos |
| 279 | 282 |
| 280 #endif // CHROMEOS_LOGIN_AUTH_CRYPTOHOME_AUTHENTICATOR_H_ | 283 #endif // CHROMEOS_LOGIN_AUTH_CRYPTOHOME_AUTHENTICATOR_H_ |
| OLD | NEW |