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& client_id, | 106 virtual void RegisterCacheEntry(const std::string& refresh_token, |
107 const std::string& refresh_token, | |
108 const ScopeSet& scopes, | 107 const ScopeSet& scopes, |
109 const std::string& access_token, | 108 const std::string& access_token, |
110 const base::Time& expiration_date) OVERRIDE; | 109 const base::Time& expiration_date) OVERRIDE; |
111 | 110 |
112 private: | 111 private: |
113 FRIEND_TEST_ALL_PREFIXES(ProfileOAuth2TokenServiceTest, | 112 FRIEND_TEST_ALL_PREFIXES(ProfileOAuth2TokenServiceTest, |
114 StaleRefreshTokensNotCached); | 113 StaleRefreshTokensNotCached); |
115 FRIEND_TEST_ALL_PREFIXES(ProfileOAuth2TokenServiceTest, | 114 FRIEND_TEST_ALL_PREFIXES(ProfileOAuth2TokenServiceTest, |
116 TokenServiceUpdateClearsCache); | 115 TokenServiceUpdateClearsCache); |
117 FRIEND_TEST_ALL_PREFIXES(ProfileOAuth2TokenServiceTest, | 116 FRIEND_TEST_ALL_PREFIXES(ProfileOAuth2TokenServiceTest, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // The auth status from the most-recently-completed request. | 153 // The auth status from the most-recently-completed request. |
155 GoogleServiceAuthError last_auth_error_; | 154 GoogleServiceAuthError last_auth_error_; |
156 | 155 |
157 // Registrar for notifications from the TokenService. | 156 // Registrar for notifications from the TokenService. |
158 content::NotificationRegistrar registrar_; | 157 content::NotificationRegistrar registrar_; |
159 | 158 |
160 DISALLOW_COPY_AND_ASSIGN(ProfileOAuth2TokenService); | 159 DISALLOW_COPY_AND_ASSIGN(ProfileOAuth2TokenService); |
161 }; | 160 }; |
162 | 161 |
163 #endif // CHROME_BROWSER_SIGNIN_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 162 #endif // CHROME_BROWSER_SIGNIN_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
OLD | NEW |