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_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
6 #define CHROME_BROWSER_SIGNIN_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 6 #define CHROME_BROWSER_SIGNIN_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 protected: | 106 protected: |
107 // OAuth2TokenService overrides. | 107 // OAuth2TokenService overrides. |
108 virtual void FetchOAuth2Token(RequestImpl* request, | 108 virtual void FetchOAuth2Token(RequestImpl* request, |
109 const std::string& account_id, | 109 const std::string& account_id, |
110 net::URLRequestContextGetter* getter, | 110 net::URLRequestContextGetter* getter, |
111 const std::string& client_id, | 111 const std::string& client_id, |
112 const std::string& client_secret, | 112 const std::string& client_secret, |
113 const ScopeSet& scopes) OVERRIDE; | 113 const ScopeSet& scopes) OVERRIDE; |
114 | 114 |
| 115 virtual void InvalidateOAuth2Token(const std::string& account_id, |
| 116 const std::string& client_id, |
| 117 const ScopeSet& scopes, |
| 118 const std::string& access_token) OVERRIDE; |
| 119 |
115 virtual std::string GetRefreshToken(const std::string& account_id) OVERRIDE; | 120 virtual std::string GetRefreshToken(const std::string& account_id) OVERRIDE; |
116 | 121 |
117 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; | 122 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; |
118 | 123 |
119 virtual void RevokeCredentialsOnServer( | 124 virtual void RevokeCredentialsOnServer( |
120 const std::string& refresh_token) OVERRIDE; | 125 const std::string& refresh_token) OVERRIDE; |
121 | 126 |
122 private: | 127 private: |
123 // Helper function to complete pending requests - if |all_scopes| is true, | 128 // Helper function to complete pending requests - if |all_scopes| is true, |
124 // then all pending requests are completed, otherwise, only those requests | 129 // then all pending requests are completed, otherwise, only those requests |
125 // matching |scopes| are completed. | 130 // matching |scopes| are completed. |
126 void CompleteRequests(bool all_scopes, | 131 void CompleteRequests(bool all_scopes, |
127 const ScopeSet& scopes, | 132 const ScopeSet& scopes, |
128 const GoogleServiceAuthError& error, | 133 const GoogleServiceAuthError& error, |
129 const std::string& access_token, | 134 const std::string& access_token, |
130 const base::Time& expiration); | 135 const base::Time& expiration); |
131 | 136 |
132 std::vector<PendingRequest> pending_requests_; | 137 std::vector<PendingRequest> pending_requests_; |
133 std::string refresh_token_; | 138 std::string refresh_token_; |
134 | 139 |
135 DISALLOW_COPY_AND_ASSIGN(FakeProfileOAuth2TokenService); | 140 DISALLOW_COPY_AND_ASSIGN(FakeProfileOAuth2TokenService); |
136 }; | 141 }; |
137 | 142 |
138 #endif // CHROME_BROWSER_SIGNIN_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 143 #endif // CHROME_BROWSER_SIGNIN_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
OLD | NEW |