| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_SYNC_SIGNIN_MANAGER_H_ | 10 #ifndef CHROME_BROWSER_SYNC_SIGNIN_MANAGER_H_ |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 virtual void OnUserInfoSuccess(const std::string& email) OVERRIDE; | 109 virtual void OnUserInfoSuccess(const std::string& email) OVERRIDE; |
| 110 virtual void OnUserInfoFailure(const GoogleServiceAuthError& error) OVERRIDE; | 110 virtual void OnUserInfoFailure(const GoogleServiceAuthError& error) OVERRIDE; |
| 111 | 111 |
| 112 // NotificationObserver | 112 // NotificationObserver |
| 113 virtual void Observe(int type, | 113 virtual void Observe(int type, |
| 114 const NotificationSource& source, | 114 const NotificationSource& source, |
| 115 const NotificationDetails& details) OVERRIDE; | 115 const NotificationDetails& details) OVERRIDE; |
| 116 | 116 |
| 117 private: | 117 private: |
| 118 void PrepareForSignin(); | 118 void PrepareForSignin(); |
| 119 void PrepareForOAuthSignin(); |
| 119 | 120 |
| 120 Profile* profile_; | 121 Profile* profile_; |
| 122 |
| 123 // ClientLogin identity. |
| 121 std::string username_; | 124 std::string username_; |
| 122 std::string password_; // This is kept empty whenever possible. | 125 std::string password_; // This is kept empty whenever possible. |
| 123 bool had_two_factor_error_; | 126 bool had_two_factor_error_; |
| 124 | 127 |
| 128 // OAuth identity. |
| 129 std::string oauth_username_; |
| 130 |
| 125 void CleanupNotificationRegistration(); | 131 void CleanupNotificationRegistration(); |
| 126 | 132 |
| 127 // Result of the last client login, kept pending the lookup of the | 133 // Result of the last client login, kept pending the lookup of the |
| 128 // canonical email. | 134 // canonical email. |
| 129 ClientLoginResult last_result_; | 135 ClientLoginResult last_result_; |
| 130 | 136 |
| 131 // Actual client login handler. | 137 // Actual client login handler. |
| 132 scoped_ptr<GaiaAuthFetcher> client_login_; | 138 scoped_ptr<GaiaAuthFetcher> client_login_; |
| 133 | 139 |
| 134 // Actual OAuth login handler. | 140 // Actual OAuth login handler. |
| 135 scoped_ptr<GaiaOAuthFetcher> oauth_login_; | 141 scoped_ptr<GaiaOAuthFetcher> oauth_login_; |
| 136 | 142 |
| 137 // Register for notifications from the TokenService. | 143 // Register for notifications from the TokenService. |
| 138 NotificationRegistrar registrar_; | 144 NotificationRegistrar registrar_; |
| 139 | 145 |
| 140 DISALLOW_COPY_AND_ASSIGN(SigninManager); | 146 DISALLOW_COPY_AND_ASSIGN(SigninManager); |
| 141 }; | 147 }; |
| 142 | 148 |
| 143 #endif // CHROME_BROWSER_SYNC_SIGNIN_MANAGER_H_ | 149 #endif // CHROME_BROWSER_SYNC_SIGNIN_MANAGER_H_ |
| OLD | NEW |