| 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_PARALLEL_AUTHENTICATOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
| 15 #include "chrome/browser/chromeos/login/authenticator.h" |
| 15 #include "chrome/browser/chromeos/login/auth_attempt_state.h" | 16 #include "chrome/browser/chromeos/login/auth_attempt_state.h" |
| 16 #include "chrome/browser/chromeos/login/auth_attempt_state_resolver.h" | 17 #include "chrome/browser/chromeos/login/auth_attempt_state_resolver.h" |
| 17 #include "chrome/browser/chromeos/login/authenticator.h" | |
| 18 #include "chrome/browser/chromeos/login/online_attempt.h" | 18 #include "chrome/browser/chromeos/login/online_attempt.h" |
| 19 #include "chrome/browser/chromeos/login/test_attempt_state.h" | 19 #include "chrome/browser/chromeos/login/test_attempt_state.h" |
| 20 #include "chrome/browser/chromeos/settings/device_settings_service.h" | |
| 21 #include "chrome/common/net/gaia/gaia_auth_consumer.h" | 20 #include "chrome/common/net/gaia/gaia_auth_consumer.h" |
| 22 | 21 |
| 23 class LoginFailure; | 22 class LoginFailure; |
| 24 class Profile; | 23 class Profile; |
| 25 | 24 |
| 26 namespace chromeos { | 25 namespace chromeos { |
| 27 | 26 |
| 28 class LoginStatusConsumer; | 27 class LoginStatusConsumer; |
| 29 | 28 |
| 30 // Authenticates a Chromium OS user against the Google Accounts ClientLogin API. | 29 // Authenticates a Chromium OS user against the Google Accounts ClientLogin API. |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 void LoadSystemSalt(); | 212 void LoadSystemSalt(); |
| 214 // If we don't have supplemental_user_key_ yet, loads it from the NSS DB. | 213 // If we don't have supplemental_user_key_ yet, loads it from the NSS DB. |
| 215 // Returns false if the key can not be loaded/created. | 214 // Returns false if the key can not be loaded/created. |
| 216 bool LoadSupplementalUserKey(); | 215 bool LoadSupplementalUserKey(); |
| 217 | 216 |
| 218 // checks if the current mounted home contains the owner case and either | 217 // checks if the current mounted home contains the owner case and either |
| 219 // continues or fails the log-in. Used for policy lost mitigation "safe-mode". | 218 // continues or fails the log-in. Used for policy lost mitigation "safe-mode". |
| 220 // Returns true if the owner check has been successful or if it is not needed. | 219 // Returns true if the owner check has been successful or if it is not needed. |
| 221 bool VerifyOwner(); | 220 bool VerifyOwner(); |
| 222 | 221 |
| 223 // Handles completion of the ownership check and continues login. | 222 // checks if the current mounted home contains the owner case and either |
| 224 void OnOwnershipChecked(DeviceSettingsService::OwnershipStatus status, | 223 // continues or fails the log-in. Used for policy lost mitigation "safe-mode". |
| 225 bool is_owner); | 224 void FinishVerifyOwnerOnFileThread(); |
| 226 | 225 |
| 227 // Records OAuth1 access token verification failure for |user_account|. | 226 // Records OAuth1 access token verification failure for |user_account|. |
| 228 void RecordOAuthCheckFailure(const std::string& user_account); | 227 void RecordOAuthCheckFailure(const std::string& user_account); |
| 229 | 228 |
| 230 // Signal login completion status for cases when a new user is added via | 229 // Signal login completion status for cases when a new user is added via |
| 231 // an external authentication provider (i.e. GAIA extension). | 230 // an external authentication provider (i.e. GAIA extension). |
| 232 void ResolveLoginCompletionStatus(); | 231 void ResolveLoginCompletionStatus(); |
| 233 | 232 |
| 234 // Used when we need to try online authentication again, after successful | 233 // Used when we need to try online authentication again, after successful |
| 235 // mount, but failed online login. | 234 // mount, but failed online login. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 246 // be able to mount her cryptohome, but online authentication will fail. | 245 // be able to mount her cryptohome, but online authentication will fail. |
| 247 // This allows us to present the same behavior to the caller, regardless | 246 // This allows us to present the same behavior to the caller, regardless |
| 248 // of the order in which we receive these results. | 247 // of the order in which we receive these results. |
| 249 bool already_reported_success_; | 248 bool already_reported_success_; |
| 250 base::Lock success_lock_; // A lock around |already_reported_success_|. | 249 base::Lock success_lock_; // A lock around |already_reported_success_|. |
| 251 | 250 |
| 252 // Flags signaling whether the owner verification has been done and the result | 251 // Flags signaling whether the owner verification has been done and the result |
| 253 // of it. | 252 // of it. |
| 254 bool owner_is_verified_; | 253 bool owner_is_verified_; |
| 255 bool user_can_login_; | 254 bool user_can_login_; |
| 255 // A lock for |owner_is_verified_| and |user_can_login_|. |
| 256 base::Lock owner_verified_lock_; |
| 256 | 257 |
| 257 // True if we use OAuth-based authentication flow. | 258 // True if we use OAuth-based authentication flow. |
| 258 bool using_oauth_; | 259 bool using_oauth_; |
| 259 | 260 |
| 260 DISALLOW_COPY_AND_ASSIGN(ParallelAuthenticator); | 261 DISALLOW_COPY_AND_ASSIGN(ParallelAuthenticator); |
| 261 }; | 262 }; |
| 262 | 263 |
| 263 } // namespace chromeos | 264 } // namespace chromeos |
| 264 | 265 |
| 265 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ | 266 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_PARALLEL_AUTHENTICATOR_H_ |
| OLD | NEW |