| 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 22 matching lines...) Expand all Loading... |
| 33 #include "google_apis/gaia/gaia_auth_consumer.h" | 33 #include "google_apis/gaia/gaia_auth_consumer.h" |
| 34 #include "google_apis/gaia/google_service_auth_error.h" | 34 #include "google_apis/gaia/google_service_auth_error.h" |
| 35 #include "net/cookies/canonical_cookie.h" | 35 #include "net/cookies/canonical_cookie.h" |
| 36 | 36 |
| 37 class CookieSettings; | 37 class CookieSettings; |
| 38 class GaiaAuthFetcher; | 38 class GaiaAuthFetcher; |
| 39 class Profile; | 39 class Profile; |
| 40 class PrefService; | 40 class PrefService; |
| 41 class SigninGlobalError; | 41 class SigninGlobalError; |
| 42 | 42 |
| 43 namespace policy { |
| 44 class CloudPolicyClient; |
| 45 } |
| 46 |
| 43 // Details for the Notification type GOOGLE_SIGNIN_SUCCESSFUL. | 47 // Details for the Notification type GOOGLE_SIGNIN_SUCCESSFUL. |
| 44 // A listener might use this to make note of a username / password | 48 // A listener might use this to make note of a username / password |
| 45 // pair for encryption keys. | 49 // pair for encryption keys. |
| 46 struct GoogleServiceSigninSuccessDetails { | 50 struct GoogleServiceSigninSuccessDetails { |
| 47 GoogleServiceSigninSuccessDetails(const std::string& in_username, | 51 GoogleServiceSigninSuccessDetails(const std::string& in_username, |
| 48 const std::string& in_password) | 52 const std::string& in_password) |
| 49 : username(in_username), | 53 : username(in_username), |
| 50 password(in_password) {} | 54 password(in_password) {} |
| 51 std::string username; | 55 std::string username; |
| 52 std::string password; | 56 std::string password; |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 // Will clear in memory data but leaves the db as such so when the browser | 235 // Will clear in memory data but leaves the db as such so when the browser |
| 232 // restarts we can use the old token(which might throw a password error). | 236 // restarts we can use the old token(which might throw a password error). |
| 233 void ClearTransientSigninData(); | 237 void ClearTransientSigninData(); |
| 234 | 238 |
| 235 // Called to handle an error from a GAIA auth fetch. Sets the last error | 239 // Called to handle an error from a GAIA auth fetch. Sets the last error |
| 236 // to |error|, sends out a notification of login failure, and clears the | 240 // to |error|, sends out a notification of login failure, and clears the |
| 237 // transient signin data if |clear_transient_data| is true. | 241 // transient signin data if |clear_transient_data| is true. |
| 238 void HandleAuthError(const GoogleServiceAuthError& error, | 242 void HandleAuthError(const GoogleServiceAuthError& error, |
| 239 bool clear_transient_data); | 243 bool clear_transient_data); |
| 240 | 244 |
| 245 #if defined(ENABLE_CONFIGURATION_POLICY) && !defined(OS_CHROMEOS) |
| 246 // Callback invoked once policy registration is complete. If registration |
| 247 // fails, |client| will be null. |
| 248 void OnRegisteredForPolicy(scoped_ptr<policy::CloudPolicyClient> client); |
| 249 |
| 250 // Callback invoked when a policy fetch request has completed. |success| is |
| 251 // true if policy was successfully fetched. |
| 252 void OnPolicyFetchComplete(bool success); |
| 253 #endif |
| 254 |
| 255 // Invoked once policy has been loaded to complete user signin. |
| 256 void CompleteSigninAfterPolicyLoad(); |
| 257 |
| 241 // ClientLogin identity. | 258 // ClientLogin identity. |
| 242 std::string possibly_invalid_username_; | 259 std::string possibly_invalid_username_; |
| 243 std::string password_; // This is kept empty whenever possible. | 260 std::string password_; // This is kept empty whenever possible. |
| 244 bool had_two_factor_error_; | 261 bool had_two_factor_error_; |
| 245 | 262 |
| 246 void CleanupNotificationRegistration(); | 263 void CleanupNotificationRegistration(); |
| 247 | 264 |
| 248 void OnGoogleServicesUsernamePatternChanged(); | 265 void OnGoogleServicesUsernamePatternChanged(); |
| 249 | 266 |
| 250 // Helper methods to notify all registered diagnostics observers with. | 267 // Helper methods to notify all registered diagnostics observers with. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 // The list of SigninDiagnosticObservers. | 305 // The list of SigninDiagnosticObservers. |
| 289 ObserverList<signin_internals_util::SigninDiagnosticsObserver, true> | 306 ObserverList<signin_internals_util::SigninDiagnosticsObserver, true> |
| 290 signin_diagnostics_observers_; | 307 signin_diagnostics_observers_; |
| 291 | 308 |
| 292 base::WeakPtrFactory<SigninManager> weak_pointer_factory_; | 309 base::WeakPtrFactory<SigninManager> weak_pointer_factory_; |
| 293 | 310 |
| 294 DISALLOW_COPY_AND_ASSIGN(SigninManager); | 311 DISALLOW_COPY_AND_ASSIGN(SigninManager); |
| 295 }; | 312 }; |
| 296 | 313 |
| 297 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_H_ | 314 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_H_ |
| OLD | NEW |