| 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 #include "chromeos/login/auth/cryptohome_authenticator.h" | 5 #include "chromeos/login/auth/cryptohome_authenticator.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 DoMount(attempt, resolver, ephemeral, create_if_nonexistent); | 205 DoMount(attempt, resolver, ephemeral, create_if_nonexistent); |
| 206 } | 206 } |
| 207 | 207 |
| 208 // This method migrates cryptohome identifier to gaia id (if needed), | 208 // This method migrates cryptohome identifier to gaia id (if needed), |
| 209 // and then calls Mount. | 209 // and then calls Mount. |
| 210 void EnsureCryptohomeMigratedToGaiaId( | 210 void EnsureCryptohomeMigratedToGaiaId( |
| 211 const base::WeakPtr<AuthAttemptState>& attempt, | 211 const base::WeakPtr<AuthAttemptState>& attempt, |
| 212 scoped_refptr<CryptohomeAuthenticator> resolver, | 212 scoped_refptr<CryptohomeAuthenticator> resolver, |
| 213 bool ephemeral, | 213 bool ephemeral, |
| 214 bool create_if_nonexistent) { | 214 bool create_if_nonexistent) { |
| 215 if (attempt->user_context.GetAccountId().GetAccountType() == |
| 216 AccountType::ACTIVE_DIRECTORY) { |
| 217 cryptohome::SetGaiaIdMigrationStatusDone( |
| 218 attempt->user_context.GetAccountId()); |
| 219 } |
| 215 const bool is_gaiaid_migration_started = switches::IsGaiaIdMigrationStarted(); | 220 const bool is_gaiaid_migration_started = switches::IsGaiaIdMigrationStarted(); |
| 216 if (!is_gaiaid_migration_started) { | 221 if (!is_gaiaid_migration_started) { |
| 217 UMACryptohomeMigrationToGaiaId(CryptohomeMigrationToGaiaId::NOT_STARTED); | 222 UMACryptohomeMigrationToGaiaId(CryptohomeMigrationToGaiaId::NOT_STARTED); |
| 218 DoMount(attempt, resolver, ephemeral, create_if_nonexistent); | 223 DoMount(attempt, resolver, ephemeral, create_if_nonexistent); |
| 219 return; | 224 return; |
| 220 } | 225 } |
| 221 if (attempt->user_context.GetAccountId().GetAccountType() == | |
| 222 AccountType::ACTIVE_DIRECTORY) { | |
| 223 cryptohome::SetGaiaIdMigrationStatusDone( | |
| 224 attempt->user_context.GetAccountId()); | |
| 225 } | |
| 226 const bool already_migrated = cryptohome::GetGaiaIdMigrationStatus( | 226 const bool already_migrated = cryptohome::GetGaiaIdMigrationStatus( |
| 227 attempt->user_context.GetAccountId()); | 227 attempt->user_context.GetAccountId()); |
| 228 const bool has_account_key = | 228 const bool has_account_key = |
| 229 attempt->user_context.GetAccountId().HasAccountIdKey(); | 229 attempt->user_context.GetAccountId().HasAccountIdKey(); |
| 230 | 230 |
| 231 bool need_migration = false; | 231 bool need_migration = false; |
| 232 if (!create_if_nonexistent && !already_migrated) { | 232 if (!create_if_nonexistent && !already_migrated) { |
| 233 if (has_account_key) { | 233 if (has_account_key) { |
| 234 need_migration = true; | 234 need_migration = true; |
| 235 } else { | 235 } else { |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 Resolve(); | 1004 Resolve(); |
| 1005 } | 1005 } |
| 1006 | 1006 |
| 1007 void CryptohomeAuthenticator::SetOwnerState(bool owner_check_finished, | 1007 void CryptohomeAuthenticator::SetOwnerState(bool owner_check_finished, |
| 1008 bool check_result) { | 1008 bool check_result) { |
| 1009 owner_is_verified_ = owner_check_finished; | 1009 owner_is_verified_ = owner_check_finished; |
| 1010 user_can_login_ = check_result; | 1010 user_can_login_ = check_result; |
| 1011 } | 1011 } |
| 1012 | 1012 |
| 1013 } // namespace chromeos | 1013 } // namespace chromeos |
| OLD | NEW |