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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_AUTH_ATTEMPT_STATE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_AUTH_ATTEMPT_STATE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_AUTH_ATTEMPT_STATE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_AUTH_ATTEMPT_STATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/chromeos/login/auth/login_status_consumer.h" | 10 #include "chrome/browser/chromeos/login/auth/login_status_consumer.h" |
11 #include "chrome/browser/chromeos/login/users/user.h" | 11 #include "chrome/browser/chromeos/login/users/user.h" |
12 #include "google_apis/gaia/gaia_auth_consumer.h" | 12 #include "google_apis/gaia/gaia_auth_consumer.h" |
13 #include "google_apis/gaia/gaia_auth_fetcher.h" | 13 #include "google_apis/gaia/gaia_auth_fetcher.h" |
14 #include "third_party/cros_system_api/dbus/service_constants.h" | 14 #include "third_party/cros_system_api/dbus/service_constants.h" |
15 | 15 |
16 namespace chromeos { | 16 namespace chromeos { |
17 | 17 |
18 // Tracks the state associated with a single attempt to log in to chromium os. | 18 // Tracks the state associated with a single attempt to log in to chromium OS. |
19 // Enforces that methods are only called on the UI thread. | 19 // Enforces that methods are only called on the UI thread. |
20 | |
21 class AuthAttemptState { | 20 class AuthAttemptState { |
22 public: | 21 public: |
23 // Used to initialize for a login attempt. | 22 // Used to initialize for a login attempt. |
24 AuthAttemptState(const UserContext& user_context, | 23 AuthAttemptState(const UserContext& user_context, |
25 const std::string& login_token, | 24 User::UserType user_type, |
26 const std::string& login_captcha, | 25 bool unlock, |
27 const User::UserType user_type, | 26 bool online_complete, |
28 const bool user_is_new); | 27 bool user_is_new); |
29 | |
30 // Used to initialize for a externally authenticated login. | |
31 AuthAttemptState(const UserContext& user_context, | |
32 const bool user_is_new); | |
33 | |
34 // Used to initialize for a screen unlock attempt. | |
35 AuthAttemptState(const std::string& username, const std::string& password); | |
36 | 28 |
37 virtual ~AuthAttemptState(); | 29 virtual ~AuthAttemptState(); |
38 | 30 |
39 // Copy |user_context| and copy |outcome| into this object, so we can have | 31 // Copy |user_context| and copy |outcome| into this object, so we can have |
40 // a copy we're sure to own, and can make available on the UI thread. | 32 // a copy we're sure to own, and can make available on the UI thread. |
41 // Must be called from the UI thread. | 33 // Must be called from the UI thread. |
42 void RecordOnlineLoginStatus( | 34 void RecordOnlineLoginStatus( |
43 const LoginFailure& outcome); | 35 const LoginFailure& outcome); |
44 | 36 |
45 // Copy |username_hash| into this object, so we can have | 37 // Copy |username_hash| into this object, so we can have |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // After the username hash request is completed, this marks whether | 108 // After the username hash request is completed, this marks whether |
117 // the request was successful. | 109 // the request was successful. |
118 bool username_hash_valid_; | 110 bool username_hash_valid_; |
119 | 111 |
120 DISALLOW_COPY_AND_ASSIGN(AuthAttemptState); | 112 DISALLOW_COPY_AND_ASSIGN(AuthAttemptState); |
121 }; | 113 }; |
122 | 114 |
123 } // namespace chromeos | 115 } // namespace chromeos |
124 | 116 |
125 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_AUTH_ATTEMPT_STATE_H_ | 117 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_AUTH_ATTEMPT_STATE_H_ |
OLD | NEW |