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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 ephemeral_mount_attempted_(false), | 377 ephemeral_mount_attempted_(false), |
378 check_key_attempted_(false), | 378 check_key_attempted_(false), |
379 already_reported_success_(false), | 379 already_reported_success_(false), |
380 owner_is_verified_(false), | 380 owner_is_verified_(false), |
381 user_can_login_(false), | 381 user_can_login_(false), |
382 remove_user_data_on_failure_(false), | 382 remove_user_data_on_failure_(false), |
383 delayed_login_failure_(NULL) { | 383 delayed_login_failure_(NULL) { |
384 } | 384 } |
385 | 385 |
386 void CryptohomeAuthenticator::AuthenticateToLogin( | 386 void CryptohomeAuthenticator::AuthenticateToLogin( |
387 content::BrowserContext* context, | 387 Profile* profile, |
388 const UserContext& user_context) { | 388 const UserContext& user_context) { |
389 authentication_context_ = context; | 389 authentication_profile_ = profile; |
390 current_state_.reset(new AuthAttemptState(user_context, | 390 current_state_.reset(new AuthAttemptState(user_context, |
391 user_manager::USER_TYPE_REGULAR, | 391 user_manager::USER_TYPE_REGULAR, |
392 false, // unlock | 392 false, // unlock |
393 false, // online_complete | 393 false, // online_complete |
394 !IsKnownUser(user_context))); | 394 !IsKnownUser(user_context))); |
395 // Reset the verified flag. | 395 // Reset the verified flag. |
396 owner_is_verified_ = false; | 396 owner_is_verified_ = false; |
397 | 397 |
398 StartMount(current_state_.get(), | 398 StartMount(current_state_.get(), |
399 scoped_refptr<CryptohomeAuthenticator>(this), | 399 scoped_refptr<CryptohomeAuthenticator>(this), |
400 false /* ephemeral */, | 400 false /* ephemeral */, |
401 false /* create_if_nonexistent */); | 401 false /* create_if_nonexistent */); |
402 } | 402 } |
403 | 403 |
404 void CryptohomeAuthenticator::CompleteLogin(content::BrowserContext* context, | 404 void CryptohomeAuthenticator::CompleteLogin(Profile* profile, |
405 const UserContext& user_context) { | 405 const UserContext& user_context) { |
406 authentication_context_ = context; | 406 authentication_profile_ = profile; |
407 current_state_.reset(new AuthAttemptState(user_context, | 407 current_state_.reset(new AuthAttemptState(user_context, |
408 user_manager::USER_TYPE_REGULAR, | 408 user_manager::USER_TYPE_REGULAR, |
409 true, // unlock | 409 true, // unlock |
410 false, // online_complete | 410 false, // online_complete |
411 !IsKnownUser(user_context))); | 411 !IsKnownUser(user_context))); |
412 | 412 |
413 // Reset the verified flag. | 413 // Reset the verified flag. |
414 owner_is_verified_ = false; | 414 owner_is_verified_ = false; |
415 | 415 |
416 StartMount(current_state_.get(), | 416 StartMount(current_state_.get(), |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 Resolve(); | 921 Resolve(); |
922 } | 922 } |
923 | 923 |
924 void CryptohomeAuthenticator::SetOwnerState(bool owner_check_finished, | 924 void CryptohomeAuthenticator::SetOwnerState(bool owner_check_finished, |
925 bool check_result) { | 925 bool check_result) { |
926 owner_is_verified_ = owner_check_finished; | 926 owner_is_verified_ = owner_check_finished; |
927 user_can_login_ = check_result; | 927 user_can_login_ = check_result; |
928 } | 928 } |
929 | 929 |
930 } // namespace chromeos | 930 } // namespace chromeos |
OLD | NEW |