| 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 TokenService will supply authentication tokens for any service that | 5 // The TokenService will supply authentication tokens for any service that |
| 6 // needs it, such as sync. Whenever the user logs in, a controller watching | 6 // needs it, such as sync. Whenever the user logs in, a controller watching |
| 7 // the token service is expected either to call ClientLogin to derive a new | 7 // the token service is expected either to call ClientLogin to derive a new |
| 8 // SID and LSID, or to use GAIA OAuth requests to derive an OAuth1 access | 8 // SID and LSID, or to use GAIA OAuth requests to derive an OAuth1 access |
| 9 // token for the OAuthLogin scope. Whenever such credentials are available, | 9 // token for the OAuthLogin scope. Whenever such credentials are available, |
| 10 // the TokenService should be updated with new credentials. The controller | 10 // the TokenService should be updated with new credentials. The controller |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 class Profile; | 61 class Profile; |
| 62 class TokenServiceTest; | 62 class TokenServiceTest; |
| 63 | 63 |
| 64 namespace net { | 64 namespace net { |
| 65 class URLRequestContextGetter; | 65 class URLRequestContextGetter; |
| 66 } | 66 } |
| 67 | 67 |
| 68 // The TokenService is a Profile member, so all calls are expected | 68 // The TokenService is a Profile member, so all calls are expected |
| 69 // from the UI thread. | 69 // from the UI thread. |
| 70 class TokenService : public GaiaAuthConsumer, | 70 class TokenService : public GaiaAuthConsumer, |
| 71 public ProfileKeyedService, | 71 public BrowserContextKeyedService, |
| 72 public WebDataServiceConsumer { | 72 public WebDataServiceConsumer { |
| 73 public: | 73 public: |
| 74 TokenService(); | 74 TokenService(); |
| 75 virtual ~TokenService(); | 75 virtual ~TokenService(); |
| 76 | 76 |
| 77 // Notification classes | 77 // Notification classes |
| 78 class TokenAvailableDetails { | 78 class TokenAvailableDetails { |
| 79 public: | 79 public: |
| 80 TokenAvailableDetails() {} | 80 TokenAvailableDetails() {} |
| 81 TokenAvailableDetails(const std::string& service, | 81 TokenAvailableDetails(const std::string& service, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 95 TokenRequestFailedDetails(const std::string& service, | 95 TokenRequestFailedDetails(const std::string& service, |
| 96 const GoogleServiceAuthError& error) | 96 const GoogleServiceAuthError& error) |
| 97 : service_(service), error_(error) {} | 97 : service_(service), error_(error) {} |
| 98 const std::string& service() const { return service_; } | 98 const std::string& service() const { return service_; } |
| 99 const GoogleServiceAuthError& error() const { return error_; } | 99 const GoogleServiceAuthError& error() const { return error_; } |
| 100 private: | 100 private: |
| 101 std::string service_; | 101 std::string service_; |
| 102 GoogleServiceAuthError error_; | 102 GoogleServiceAuthError error_; |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 // ProfileKeyedService implementation. | 105 // BrowserContextKeyedService implementation. |
| 106 virtual void Shutdown() OVERRIDE; | 106 virtual void Shutdown() OVERRIDE; |
| 107 | 107 |
| 108 // Methods to register or remove SigninDiagnosticObservers | 108 // Methods to register or remove SigninDiagnosticObservers |
| 109 void AddSigninDiagnosticsObserver( | 109 void AddSigninDiagnosticsObserver( |
| 110 signin_internals_util::SigninDiagnosticsObserver* observer); | 110 signin_internals_util::SigninDiagnosticsObserver* observer); |
| 111 void RemoveSigninDiagnosticsObserver( | 111 void RemoveSigninDiagnosticsObserver( |
| 112 signin_internals_util::SigninDiagnosticsObserver* observer); | 112 signin_internals_util::SigninDiagnosticsObserver* observer); |
| 113 | 113 |
| 114 // Initialize this token service with a request source | 114 // Initialize this token service with a request source |
| 115 // (usually from a GaiaAuthConsumer constant), and the profile. | 115 // (usually from a GaiaAuthConsumer constant), and the profile. |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 256 |
| 257 friend class TokenServiceTest; | 257 friend class TokenServiceTest; |
| 258 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryBasic); | 258 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryBasic); |
| 259 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryAdvanced); | 259 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, LoadTokensIntoMemoryAdvanced); |
| 260 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, FullIntegrationNewServicesAdded); | 260 FRIEND_TEST_ALL_PREFIXES(TokenServiceTest, FullIntegrationNewServicesAdded); |
| 261 | 261 |
| 262 DISALLOW_COPY_AND_ASSIGN(TokenService); | 262 DISALLOW_COPY_AND_ASSIGN(TokenService); |
| 263 }; | 263 }; |
| 264 | 264 |
| 265 #endif // CHROME_BROWSER_SIGNIN_TOKEN_SERVICE_H_ | 265 #endif // CHROME_BROWSER_SIGNIN_TOKEN_SERVICE_H_ |
| OLD | NEW |