| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_SIGNIN_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SIGNIN_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 6 #define CHROME_BROWSER_SIGNIN_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 // Updates the internal cache of the result from the most-recently-completed | 97 // Updates the internal cache of the result from the most-recently-completed |
| 98 // auth request (used for reporting errors to the user). | 98 // auth request (used for reporting errors to the user). |
| 99 virtual void UpdateAuthError(const GoogleServiceAuthError& error) OVERRIDE; | 99 virtual void UpdateAuthError(const GoogleServiceAuthError& error) OVERRIDE; |
| 100 | 100 |
| 101 // Overridden to not cache tokens if the TokenService refresh token | 101 // Overridden to not cache tokens if the TokenService refresh token |
| 102 // changes while a token fetch is in-flight. If the user logs out and | 102 // changes while a token fetch is in-flight. If the user logs out and |
| 103 // logs back in with a different account, then any in-flight token | 103 // logs back in with a different account, then any in-flight token |
| 104 // fetches will be for the old account's refresh token. Therefore | 104 // fetches will be for the old account's refresh token. Therefore |
| 105 // when they come back, they shouldn't be cached. | 105 // when they come back, they shouldn't be cached. |
| 106 virtual void RegisterCacheEntry(const std::string& refresh_token, | 106 virtual void RegisterCacheEntry(const std::string& client_id, |
| 107 const std::string& refresh_token, |
| 107 const ScopeSet& scopes, | 108 const ScopeSet& scopes, |
| 108 const std::string& access_token, | 109 const std::string& access_token, |
| 109 const base::Time& expiration_date) OVERRIDE; | 110 const base::Time& expiration_date) OVERRIDE; |
| 110 | 111 |
| 111 private: | 112 private: |
| 112 FRIEND_TEST_ALL_PREFIXES(ProfileOAuth2TokenServiceTest, | 113 FRIEND_TEST_ALL_PREFIXES(ProfileOAuth2TokenServiceTest, |
| 113 StaleRefreshTokensNotCached); | 114 StaleRefreshTokensNotCached); |
| 114 FRIEND_TEST_ALL_PREFIXES(ProfileOAuth2TokenServiceTest, | 115 FRIEND_TEST_ALL_PREFIXES(ProfileOAuth2TokenServiceTest, |
| 115 TokenServiceUpdateClearsCache); | 116 TokenServiceUpdateClearsCache); |
| 116 FRIEND_TEST_ALL_PREFIXES(ProfileOAuth2TokenServiceTest, | 117 FRIEND_TEST_ALL_PREFIXES(ProfileOAuth2TokenServiceTest, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // The auth status from the most-recently-completed request. | 154 // The auth status from the most-recently-completed request. |
| 154 GoogleServiceAuthError last_auth_error_; | 155 GoogleServiceAuthError last_auth_error_; |
| 155 | 156 |
| 156 // Registrar for notifications from the TokenService. | 157 // Registrar for notifications from the TokenService. |
| 157 content::NotificationRegistrar registrar_; | 158 content::NotificationRegistrar registrar_; |
| 158 | 159 |
| 159 DISALLOW_COPY_AND_ASSIGN(ProfileOAuth2TokenService); | 160 DISALLOW_COPY_AND_ASSIGN(ProfileOAuth2TokenService); |
| 160 }; | 161 }; |
| 161 | 162 |
| 162 #endif // CHROME_BROWSER_SIGNIN_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 163 #endif // CHROME_BROWSER_SIGNIN_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
| OLD | NEW |