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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, | 115 virtual void InvalidateOAuth2Token(const std::string& account_id, |
116 const std::string& client_id, | 116 const std::string& client_id, |
117 const ScopeSet& scopes, | 117 const ScopeSet& scopes, |
118 const std::string& access_token) OVERRIDE; | 118 const std::string& access_token) OVERRIDE; |
119 | 119 |
120 virtual std::string GetRefreshToken(const std::string& account_id) OVERRIDE; | 120 virtual std::string GetRefreshToken(const std::string& account_id) OVERRIDE; |
121 | 121 |
122 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; | |
123 | |
124 virtual void RevokeCredentialsOnServer( | |
125 const std::string& refresh_token) OVERRIDE; | |
126 | |
127 private: | 122 private: |
128 // Helper function to complete pending requests - if |all_scopes| is true, | 123 // Helper function to complete pending requests - if |all_scopes| is true, |
129 // then all pending requests are completed, otherwise, only those requests | 124 // then all pending requests are completed, otherwise, only those requests |
130 // matching |scopes| are completed. | 125 // matching |scopes| are completed. |
131 void CompleteRequests(bool all_scopes, | 126 void CompleteRequests(bool all_scopes, |
132 const ScopeSet& scopes, | 127 const ScopeSet& scopes, |
133 const GoogleServiceAuthError& error, | 128 const GoogleServiceAuthError& error, |
134 const std::string& access_token, | 129 const std::string& access_token, |
135 const base::Time& expiration); | 130 const base::Time& expiration); |
136 | 131 |
137 std::vector<PendingRequest> pending_requests_; | 132 std::vector<PendingRequest> pending_requests_; |
138 std::string refresh_token_; | 133 std::string refresh_token_; |
139 | 134 |
140 DISALLOW_COPY_AND_ASSIGN(FakeProfileOAuth2TokenService); | 135 DISALLOW_COPY_AND_ASSIGN(FakeProfileOAuth2TokenService); |
141 }; | 136 }; |
142 | 137 |
143 #endif // CHROME_BROWSER_SIGNIN_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ | 138 #endif // CHROME_BROWSER_SIGNIN_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_H_ |
OLD | NEW |