OLD | NEW |
(Empty) | |
| 1 #ifndef GOOGLE_APIS_GAIA_FAKE_OAUTH2_TOKEN_SERVICE_DELEGATE_H_ |
| 2 #define GOOGLE_APIS_GAIA_FAKE_OAUTH2_TOKEN_SERVICE_DELEGATE_H_ |
| 3 |
| 4 #include <set> |
| 5 #include <string> |
| 6 |
| 7 #include "google_apis/gaia/oauth2_token_service_delegate.h" |
| 8 |
| 9 namespace net { |
| 10 class URLRequestContextGetter; |
| 11 } |
| 12 |
| 13 class FakeOAuth2TokenServiceDelegate : public OAuth2TokenServiceDelegate { |
| 14 public: |
| 15 FakeOAuth2TokenServiceDelegate(); |
| 16 ~FakeOAuth2TokenServiceDelegate() override; |
| 17 |
| 18 // OAuth2TokenService overrides. |
| 19 net::URLRequestContextGetter* GetRequestContext() const override; |
| 20 |
| 21 OAuth2AccessTokenFetcher* CreateAccessTokenFetcher( |
| 22 const std::string& account_id, |
| 23 net::URLRequestContextGetter* getter, |
| 24 OAuth2AccessTokenConsumer* consumer) override; |
| 25 |
| 26 bool RefreshTokenIsAvailable(const std::string& account_id) const override; |
| 27 std::string GetRefreshToken(const std::string& account_id) const override; |
| 28 void UpdateAuthError(const std::string& account_id, |
| 29 const GoogleServiceAuthError& error) override; |
| 30 |
| 31 std::vector<std::string> GetAccounts() override; |
| 32 void RevokeAllCredentials() override; |
| 33 |
| 34 void AddAccount(const std::string& account_id); |
| 35 void RemoveAccount(const std::string& account_id); |
| 36 |
| 37 void set_request_context(net::URLRequestContextGetter* request_context) { |
| 38 request_context_ = request_context; |
| 39 } |
| 40 |
| 41 private: |
| 42 std::set<std::string> account_ids_; |
| 43 |
| 44 net::URLRequestContextGetter* request_context_; // weak |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(FakeOAuth2TokenServiceDelegate); |
| 47 }; |
| 48 |
| 49 #endif |
OLD | NEW |