Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(529)

Side by Side Diff: google_apis/gaia/fake_oauth2_token_service_delegate.h

Issue 1143323005: Refactor AO2TS to make it easier to componentize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update for google_apis_unittests Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698