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 // The signin manager encapsulates some functionality tracking | 5 // The signin manager encapsulates some functionality tracking |
6 // which user is signed in. When a user is signed in, a ClientLogin | 6 // which user is signed in. When a user is signed in, a ClientLogin |
7 // request is run on their behalf. Auth tokens are fetched from Google | 7 // request is run on their behalf. Auth tokens are fetched from Google |
8 // and the results are stored in the TokenService. | 8 // and the results are stored in the TokenService. |
9 // | 9 // |
10 // **NOTE** on semantics of SigninManager: | 10 // **NOTE** on semantics of SigninManager: |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 void ProvideSecondFactorAccessCode(const std::string& access_code); | 90 void ProvideSecondFactorAccessCode(const std::string& access_code); |
91 | 91 |
92 // Sign a user out, removing the preference, erasing all keys | 92 // Sign a user out, removing the preference, erasing all keys |
93 // associated with the user, and canceling all auth in progress. | 93 // associated with the user, and canceling all auth in progress. |
94 virtual void SignOut(); | 94 virtual void SignOut(); |
95 | 95 |
96 // Returns the auth error associated with the last login attempt, or None if | 96 // Returns the auth error associated with the last login attempt, or None if |
97 // there have been no login failures. | 97 // there have been no login failures. |
98 virtual const GoogleServiceAuthError& GetLoginAuthError() const; | 98 virtual const GoogleServiceAuthError& GetLoginAuthError() const; |
99 | 99 |
| 100 // Returns true if there's a signin in progress. |
| 101 bool AuthInProgress() const; |
| 102 |
100 // GaiaAuthConsumer | 103 // GaiaAuthConsumer |
101 virtual void OnClientLoginSuccess(const ClientLoginResult& result) OVERRIDE; | 104 virtual void OnClientLoginSuccess(const ClientLoginResult& result) OVERRIDE; |
102 virtual void OnClientLoginFailure( | 105 virtual void OnClientLoginFailure( |
103 const GoogleServiceAuthError& error) OVERRIDE; | 106 const GoogleServiceAuthError& error) OVERRIDE; |
104 virtual void OnGetUserInfoSuccess(const std::string& key, | 107 virtual void OnGetUserInfoSuccess(const std::string& key, |
105 const std::string& value) OVERRIDE; | 108 const std::string& value) OVERRIDE; |
106 virtual void OnGetUserInfoKeyNotFound(const std::string& key) OVERRIDE; | 109 virtual void OnGetUserInfoKeyNotFound(const std::string& key) OVERRIDE; |
107 virtual void OnGetUserInfoFailure( | 110 virtual void OnGetUserInfoFailure( |
108 const GoogleServiceAuthError& error) OVERRIDE; | 111 const GoogleServiceAuthError& error) OVERRIDE; |
109 virtual void OnTokenAuthFailure(const GoogleServiceAuthError& error) OVERRIDE; | 112 virtual void OnTokenAuthFailure(const GoogleServiceAuthError& error) OVERRIDE; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 // The last error we received when logging in (used to retrieve details like | 171 // The last error we received when logging in (used to retrieve details like |
169 // captchas, etc). | 172 // captchas, etc). |
170 GoogleServiceAuthError last_login_auth_error_; | 173 GoogleServiceAuthError last_login_auth_error_; |
171 | 174 |
172 std::string authenticated_username_; | 175 std::string authenticated_username_; |
173 | 176 |
174 DISALLOW_COPY_AND_ASSIGN(SigninManager); | 177 DISALLOW_COPY_AND_ASSIGN(SigninManager); |
175 }; | 178 }; |
176 | 179 |
177 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_H_ | 180 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_H_ |
OLD | NEW |