| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/chromeos/login/auth/test_attempt_state.h" | |
| 6 | |
| 7 #include "components/user_manager/user_type.h" | |
| 8 #include "google_apis/gaia/gaia_auth_consumer.h" | |
| 9 | |
| 10 namespace chromeos { | |
| 11 | |
| 12 TestAttemptState::TestAttemptState(const UserContext& credentials, | |
| 13 const bool user_is_new) | |
| 14 : AuthAttemptState(credentials, | |
| 15 user_manager::USER_TYPE_REGULAR, | |
| 16 false, // unlock | |
| 17 false, // online_complete | |
| 18 user_is_new) { | |
| 19 } | |
| 20 | |
| 21 TestAttemptState::~TestAttemptState() {} | |
| 22 | |
| 23 void TestAttemptState::PresetOnlineLoginStatus(const AuthFailure& outcome) { | |
| 24 online_complete_ = true; | |
| 25 online_outcome_ = outcome; | |
| 26 } | |
| 27 | |
| 28 void TestAttemptState::DisableHosted() { | |
| 29 hosted_policy_ = GaiaAuthFetcher::HostedAccountsNotAllowed; | |
| 30 } | |
| 31 | |
| 32 void TestAttemptState::PresetCryptohomeStatus( | |
| 33 bool cryptohome_outcome, | |
| 34 cryptohome::MountError cryptohome_code) { | |
| 35 cryptohome_complete_ = true; | |
| 36 cryptohome_outcome_ = cryptohome_outcome; | |
| 37 cryptohome_code_ = cryptohome_code; | |
| 38 } | |
| 39 | |
| 40 bool TestAttemptState::online_complete() { | |
| 41 return online_complete_; | |
| 42 } | |
| 43 | |
| 44 const AuthFailure& TestAttemptState::online_outcome() { | |
| 45 return online_outcome_; | |
| 46 } | |
| 47 | |
| 48 bool TestAttemptState::is_first_time_user() { | |
| 49 return is_first_time_user_; | |
| 50 } | |
| 51 | |
| 52 GaiaAuthFetcher::HostedAccountsSetting TestAttemptState::hosted_policy() { | |
| 53 return hosted_policy_; | |
| 54 } | |
| 55 | |
| 56 bool TestAttemptState::cryptohome_complete() { | |
| 57 return cryptohome_complete_; | |
| 58 } | |
| 59 | |
| 60 bool TestAttemptState::cryptohome_outcome() { | |
| 61 return cryptohome_outcome_; | |
| 62 } | |
| 63 | |
| 64 cryptohome::MountError TestAttemptState::cryptohome_code() { | |
| 65 return cryptohome_code_; | |
| 66 } | |
| 67 | |
| 68 } // namespace chromeos | |
| OLD | NEW |