| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // contains a multi-login session. Otherwise the end result of this call is | 91 // contains a multi-login session. Otherwise the end result of this call is |
| 92 // the same as StartSignIn(). | 92 // the same as StartSignIn(). |
| 93 virtual void StartSignInWithCredentials(const std::string& session_index, | 93 virtual void StartSignInWithCredentials(const std::string& session_index, |
| 94 const std::string& username, | 94 const std::string& username, |
| 95 const std::string& password); | 95 const std::string& password); |
| 96 | 96 |
| 97 // Sign a user out, removing the preference, erasing all keys | 97 // Sign a user out, removing the preference, erasing all keys |
| 98 // associated with the user, and canceling all auth in progress. | 98 // associated with the user, and canceling all auth in progress. |
| 99 virtual void SignOut(); | 99 virtual void SignOut(); |
| 100 | 100 |
| 101 // Returns true if there's a signin in progress. | 101 // Returns true if there's a signin in progress. Virtual so it can be |
| 102 bool AuthInProgress() const; | 102 // overridden by mocks. |
| 103 virtual bool AuthInProgress() const; |
| 103 | 104 |
| 104 // Handles errors if a required user info key is not returned from the | 105 // Handles errors if a required user info key is not returned from the |
| 105 // GetUserInfo call. | 106 // GetUserInfo call. |
| 106 void OnGetUserInfoKeyNotFound(const std::string& key); | 107 void OnGetUserInfoKeyNotFound(const std::string& key); |
| 107 | 108 |
| 108 // GaiaAuthConsumer | 109 // GaiaAuthConsumer |
| 109 virtual void OnClientLoginSuccess(const ClientLoginResult& result) OVERRIDE; | 110 virtual void OnClientLoginSuccess(const ClientLoginResult& result) OVERRIDE; |
| 110 virtual void OnClientLoginFailure( | 111 virtual void OnClientLoginFailure( |
| 111 const GoogleServiceAuthError& error) OVERRIDE; | 112 const GoogleServiceAuthError& error) OVERRIDE; |
| 112 virtual void OnOAuthLoginTokenSuccess(const std::string& refresh_token, | 113 virtual void OnOAuthLoginTokenSuccess(const std::string& refresh_token, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 165 |
| 165 // Register for notifications from the TokenService. | 166 // Register for notifications from the TokenService. |
| 166 content::NotificationRegistrar registrar_; | 167 content::NotificationRegistrar registrar_; |
| 167 | 168 |
| 168 std::string authenticated_username_; | 169 std::string authenticated_username_; |
| 169 | 170 |
| 170 DISALLOW_COPY_AND_ASSIGN(SigninManager); | 171 DISALLOW_COPY_AND_ASSIGN(SigninManager); |
| 171 }; | 172 }; |
| 172 | 173 |
| 173 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_H_ | 174 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_H_ |
| OLD | NEW |