Chromium Code Reviews| 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 21 matching lines...) Expand all Loading... | |
| 32 #include "google_apis/gaia/gaia_auth_consumer.h" | 32 #include "google_apis/gaia/gaia_auth_consumer.h" |
| 33 #include "google_apis/gaia/google_service_auth_error.h" | 33 #include "google_apis/gaia/google_service_auth_error.h" |
| 34 #include "net/cookies/canonical_cookie.h" | 34 #include "net/cookies/canonical_cookie.h" |
| 35 | 35 |
| 36 class CookieSettings; | 36 class CookieSettings; |
| 37 class GaiaAuthFetcher; | 37 class GaiaAuthFetcher; |
| 38 class Profile; | 38 class Profile; |
| 39 class PrefService; | 39 class PrefService; |
| 40 class SigninGlobalError; | 40 class SigninGlobalError; |
| 41 | 41 |
| 42 namespace policy { | |
| 43 class CloudPolicyClient; | |
| 44 } | |
| 45 | |
| 42 // Details for the Notification type GOOGLE_SIGNIN_SUCCESSFUL. | 46 // Details for the Notification type GOOGLE_SIGNIN_SUCCESSFUL. |
| 43 // A listener might use this to make note of a username / password | 47 // A listener might use this to make note of a username / password |
| 44 // pair for encryption keys. | 48 // pair for encryption keys. |
| 45 struct GoogleServiceSigninSuccessDetails { | 49 struct GoogleServiceSigninSuccessDetails { |
| 46 GoogleServiceSigninSuccessDetails(const std::string& in_username, | 50 GoogleServiceSigninSuccessDetails(const std::string& in_username, |
| 47 const std::string& in_password) | 51 const std::string& in_password) |
| 48 : username(in_username), | 52 : username(in_username), |
| 49 password(in_password) {} | 53 password(in_password) {} |
| 50 std::string username; | 54 std::string username; |
| 51 std::string password; | 55 std::string password; |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 225 // Will clear in memory data but leaves the db as such so when the browser | 229 // Will clear in memory data but leaves the db as such so when the browser |
| 226 // restarts we can use the old token(which might throw a password error). | 230 // restarts we can use the old token(which might throw a password error). |
| 227 void ClearTransientSigninData(); | 231 void ClearTransientSigninData(); |
| 228 | 232 |
| 229 // Called to handle an error from a GAIA auth fetch. Sets the last error | 233 // Called to handle an error from a GAIA auth fetch. Sets the last error |
| 230 // to |error|, sends out a notification of login failure, and clears the | 234 // to |error|, sends out a notification of login failure, and clears the |
| 231 // transient signin data if |clear_transient_data| is true. | 235 // transient signin data if |clear_transient_data| is true. |
| 232 void HandleAuthError(const GoogleServiceAuthError& error, | 236 void HandleAuthError(const GoogleServiceAuthError& error, |
| 233 bool clear_transient_data); | 237 bool clear_transient_data); |
| 234 | 238 |
| 239 // Callback invoked once policy registration is complete. If registration | |
| 240 // fails, |policy_token| will be empty. | |
|
Joao da Silva
2013/02/07 23:01:25
|policy_token| -> |client|?
Andrew T Wilson (Slow)
2013/02/08 10:48:07
Done.
| |
| 241 void OnRegisteredForPolicy(scoped_ptr<policy::CloudPolicyClient> client); | |
| 242 | |
| 243 // Callback invoked when a policy fetch request has completed. |success| is | |
| 244 // true if policy was successfully fetched. | |
| 245 void OnPolicyFetchComplete(bool success); | |
|
Joao da Silva
2013/02/07 23:01:25
These 2 methods #ifdefd
Andrew T Wilson (Slow)
2013/02/08 10:48:07
Done.
| |
| 246 | |
| 247 // Invoked once policy has been loaded to complete user signin. | |
| 248 void CompleteSigninAfterPolicyLoad(); | |
| 249 | |
| 235 // ClientLogin identity. | 250 // ClientLogin identity. |
| 236 std::string possibly_invalid_username_; | 251 std::string possibly_invalid_username_; |
| 237 std::string password_; // This is kept empty whenever possible. | 252 std::string password_; // This is kept empty whenever possible. |
| 238 bool had_two_factor_error_; | 253 bool had_two_factor_error_; |
| 239 | 254 |
| 240 void CleanupNotificationRegistration(); | 255 void CleanupNotificationRegistration(); |
| 241 | 256 |
| 242 void OnGoogleServicesUsernamePatternChanged(); | 257 void OnGoogleServicesUsernamePatternChanged(); |
| 243 | 258 |
| 244 // Helper methods to notify all registered diagnostics observers with. | 259 // Helper methods to notify all registered diagnostics observers with. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 279 // The list of SigninDiagnosticObservers. | 294 // The list of SigninDiagnosticObservers. |
| 280 ObserverList<signin_internals_util::SigninDiagnosticsObserver, true> | 295 ObserverList<signin_internals_util::SigninDiagnosticsObserver, true> |
| 281 signin_diagnostics_observers_; | 296 signin_diagnostics_observers_; |
| 282 | 297 |
| 283 base::WeakPtrFactory<SigninManager> weak_pointer_factory_; | 298 base::WeakPtrFactory<SigninManager> weak_pointer_factory_; |
| 284 | 299 |
| 285 DISALLOW_COPY_AND_ASSIGN(SigninManager); | 300 DISALLOW_COPY_AND_ASSIGN(SigninManager); |
| 286 }; | 301 }; |
| 287 | 302 |
| 288 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_H_ | 303 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_H_ |
| OLD | NEW |