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 #include "chrome/browser/chromeos/login/auth_attempt_state.h" | 5 #include "chrome/browser/chromeos/login/auth_attempt_state.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "google_apis/gaia/gaia_auth_consumer.h" | 10 #include "google_apis/gaia/gaia_auth_consumer.h" |
11 #include "google_apis/gaia/gaia_auth_fetcher.h" | 11 #include "google_apis/gaia/gaia_auth_fetcher.h" |
12 | 12 |
13 using content::BrowserThread; | 13 using content::BrowserThread; |
14 | 14 |
15 namespace chromeos { | 15 namespace chromeos { |
16 | 16 |
17 AuthAttemptState::AuthAttemptState(const std::string& username, | 17 AuthAttemptState::AuthAttemptState(const UserCredentials& credentials, |
18 const std::string& password, | |
19 const std::string& ascii_hash, | 18 const std::string& ascii_hash, |
20 const std::string& login_token, | 19 const std::string& login_token, |
21 const std::string& login_captcha, | 20 const std::string& login_captcha, |
22 const User::UserType user_type, | 21 const User::UserType user_type, |
23 const bool user_is_new) | 22 const bool user_is_new) |
24 : username(username), | 23 : credentials(credentials), |
25 password(password), | |
26 ascii_hash(ascii_hash), | 24 ascii_hash(ascii_hash), |
27 login_token(login_token), | 25 login_token(login_token), |
28 login_captcha(login_captcha), | 26 login_captcha(login_captcha), |
29 user_type(user_type), | 27 user_type(user_type), |
30 unlock(false), | 28 unlock(false), |
31 online_complete_(false), | 29 online_complete_(false), |
32 online_outcome_(LoginFailure::NONE), | 30 online_outcome_(LoginFailure::NONE), |
33 hosted_policy_(GaiaAuthFetcher::HostedAccountsAllowed), | 31 hosted_policy_(GaiaAuthFetcher::HostedAccountsAllowed), |
34 is_first_time_user_(user_is_new), | 32 is_first_time_user_(user_is_new), |
35 cryptohome_complete_(false), | 33 cryptohome_complete_(false), |
36 cryptohome_outcome_(false), | 34 cryptohome_outcome_(false), |
37 cryptohome_code_(cryptohome::MOUNT_ERROR_NONE) { | 35 cryptohome_code_(cryptohome::MOUNT_ERROR_NONE) { |
38 } | 36 } |
39 | 37 |
40 AuthAttemptState::AuthAttemptState(const std::string& username, | 38 AuthAttemptState::AuthAttemptState(const std::string& username, |
41 const std::string& ascii_hash) | 39 const std::string& ascii_hash) |
42 : username(username), | 40 : credentials(username, "", ""), |
43 ascii_hash(ascii_hash), | 41 ascii_hash(ascii_hash), |
44 user_type(User::USER_TYPE_REGULAR), | 42 user_type(User::USER_TYPE_REGULAR), |
45 unlock(true), | 43 unlock(true), |
46 online_complete_(true), | 44 online_complete_(true), |
47 online_outcome_(LoginFailure::UNLOCK_FAILED), | 45 online_outcome_(LoginFailure::UNLOCK_FAILED), |
48 hosted_policy_(GaiaAuthFetcher::HostedAccountsAllowed), | 46 hosted_policy_(GaiaAuthFetcher::HostedAccountsAllowed), |
49 is_first_time_user_(false), | 47 is_first_time_user_(false), |
50 cryptohome_complete_(false), | 48 cryptohome_complete_(false), |
51 cryptohome_outcome_(false), | 49 cryptohome_outcome_(false), |
52 cryptohome_code_(cryptohome::MOUNT_ERROR_NONE) { | 50 cryptohome_code_(cryptohome::MOUNT_ERROR_NONE) { |
53 } | 51 } |
54 | 52 |
55 AuthAttemptState::AuthAttemptState(const std::string& username, | 53 AuthAttemptState::AuthAttemptState(const UserCredentials& credentials, |
56 const std::string& password, | |
57 const std::string& ascii_hash, | 54 const std::string& ascii_hash, |
58 const bool user_is_new) | 55 const bool user_is_new) |
59 : username(username), | 56 : credentials(credentials), |
60 password(password), | |
61 ascii_hash(ascii_hash), | 57 ascii_hash(ascii_hash), |
62 user_type(User::USER_TYPE_REGULAR), | 58 user_type(User::USER_TYPE_REGULAR), |
63 unlock(true), | 59 unlock(true), |
64 online_complete_(false), | 60 online_complete_(false), |
65 online_outcome_(LoginFailure::NONE), | 61 online_outcome_(LoginFailure::NONE), |
66 hosted_policy_(GaiaAuthFetcher::HostedAccountsAllowed), | 62 hosted_policy_(GaiaAuthFetcher::HostedAccountsAllowed), |
67 is_first_time_user_(user_is_new), | 63 is_first_time_user_(user_is_new), |
68 cryptohome_complete_(false), | 64 cryptohome_complete_(false), |
69 cryptohome_outcome_(false), | 65 cryptohome_outcome_(false), |
70 cryptohome_code_(cryptohome::MOUNT_ERROR_NONE) { | 66 cryptohome_code_(cryptohome::MOUNT_ERROR_NONE) { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 128 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
133 return cryptohome_outcome_; | 129 return cryptohome_outcome_; |
134 } | 130 } |
135 | 131 |
136 cryptohome::MountError AuthAttemptState::cryptohome_code() { | 132 cryptohome::MountError AuthAttemptState::cryptohome_code() { |
137 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 133 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
138 return cryptohome_code_; | 134 return cryptohome_code_; |
139 } | 135 } |
140 | 136 |
141 } // namespace chromeos | 137 } // namespace chromeos |
OLD | NEW |