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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 public: | 28 public: |
29 explicit Authenticator(LoginStatusConsumer* consumer); | 29 explicit Authenticator(LoginStatusConsumer* consumer); |
30 | 30 |
31 // Given externally authenticated username and password (part of | 31 // Given externally authenticated username and password (part of |
32 // |user_context|), this method attempts to complete authentication process. | 32 // |user_context|), this method attempts to complete authentication process. |
33 virtual void CompleteLogin(Profile* profile, | 33 virtual void CompleteLogin(Profile* profile, |
34 const UserContext& user_context) = 0; | 34 const UserContext& user_context) = 0; |
35 | 35 |
36 // Given a user credentials in |user_context|, | 36 // Given a user credentials in |user_context|, |
37 // this method attempts to authenticate to login. | 37 // this method attempts to authenticate to login. |
38 // Optionally |login_token| and |login_captcha| could be provided. | |
39 // Must be called on the UI thread. | 38 // Must be called on the UI thread. |
40 virtual void AuthenticateToLogin(Profile* profile, | 39 virtual void AuthenticateToLogin(Profile* profile, |
41 const UserContext& user_context, | 40 const UserContext& user_context) = 0; |
42 const std::string& login_token, | |
43 const std::string& login_captcha) = 0; | |
44 | 41 |
45 // Given a user credentials in |user_context|, this method attempts to | 42 // Given a user credentials in |user_context|, this method attempts to |
46 // authenticate to unlock the computer. | 43 // authenticate to unlock the computer. |
47 // Must be called on the UI thread. | 44 // Must be called on the UI thread. |
48 virtual void AuthenticateToUnlock( | 45 virtual void AuthenticateToUnlock( |
49 const UserContext& user_context) = 0; | 46 const UserContext& user_context) = 0; |
50 | 47 |
51 // Initiates locally managed user login. | 48 // Initiates locally managed user login. |
52 virtual void LoginAsLocallyManagedUser( | 49 virtual void LoginAsLocallyManagedUser( |
53 const UserContext& user_context) = 0; | 50 const UserContext& user_context) = 0; |
(...skipping 26 matching lines...) Expand all Loading... |
80 // Call this method to migrate the user's encrypted data | 77 // Call this method to migrate the user's encrypted data |
81 // forward to use his new password. |old_password| is the password | 78 // forward to use his new password. |old_password| is the password |
82 // his data was last encrypted with. | 79 // his data was last encrypted with. |
83 virtual void RecoverEncryptedData( | 80 virtual void RecoverEncryptedData( |
84 const std::string& old_password) = 0; | 81 const std::string& old_password) = 0; |
85 | 82 |
86 // Call this method to erase the user's encrypted data | 83 // Call this method to erase the user's encrypted data |
87 // and create a new cryptohome. | 84 // and create a new cryptohome. |
88 virtual void ResyncEncryptedData() = 0; | 85 virtual void ResyncEncryptedData() = 0; |
89 | 86 |
90 // Attempt to authenticate online again. | |
91 virtual void RetryAuth(Profile* profile, | |
92 const UserContext& user_context, | |
93 const std::string& login_token, | |
94 const std::string& login_captcha) = 0; | |
95 | |
96 // Profile (usually off the record ) that was used to perform the last | 87 // Profile (usually off the record ) that was used to perform the last |
97 // authentication process. | 88 // authentication process. |
98 Profile* authentication_profile() { return authentication_profile_; } | 89 Profile* authentication_profile() { return authentication_profile_; } |
99 | 90 |
100 // Sets consumer explicitly. | 91 // Sets consumer explicitly. |
101 void SetConsumer(LoginStatusConsumer* consumer); | 92 void SetConsumer(LoginStatusConsumer* consumer); |
102 | 93 |
103 protected: | 94 protected: |
104 virtual ~Authenticator(); | 95 virtual ~Authenticator(); |
105 | 96 |
106 LoginStatusConsumer* consumer_; | 97 LoginStatusConsumer* consumer_; |
107 Profile* authentication_profile_; | 98 Profile* authentication_profile_; |
108 | 99 |
109 private: | 100 private: |
110 friend class base::RefCountedThreadSafe<Authenticator>; | 101 friend class base::RefCountedThreadSafe<Authenticator>; |
111 | 102 |
112 DISALLOW_COPY_AND_ASSIGN(Authenticator); | 103 DISALLOW_COPY_AND_ASSIGN(Authenticator); |
113 }; | 104 }; |
114 | 105 |
115 } // namespace chromeos | 106 } // namespace chromeos |
116 | 107 |
117 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ | 108 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTHENTICATOR_H_ |
OLD | NEW |