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

Side by Side Diff: chrome/browser/signin/fake_profile_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 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SIGNIN_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE_DELEGATE_H_
6 #define CHROME_BROWSER_SIGNIN_FAKE_PROFILE_OAUTH2_TOKEN_SERVICE__DELEGATE_H_
7
8 #include "google_apis/gaia/oauth2_token_service_delegate.h"
9
10 class FakeProfileOAuth2TokenServiceDelegate
11 : public OAuth2TokenServiceDelegate {
Roger Tawa OOO till Jul 10th 2015/05/28 14:54:43 Why doesn't this derive from FakeOAuth2TokenServic
gogerald1 2015/06/03 18:12:58 Done.
12 public:
13 FakeProfileOAuth2TokenServiceDelegate();
14 ~FakeProfileOAuth2TokenServiceDelegate() override;
15
16 OAuth2AccessTokenFetcher* CreateAccessTokenFetcher(
17 const std::string& account_id,
18 net::URLRequestContextGetter* getter,
19 OAuth2AccessTokenConsumer* consumer) override;
20
21 // Overriden to make sure it works on Android.
22 bool RefreshTokenIsAvailable(const std::string& account_id) const override;
23 std::string GetRefreshToken(const std::string& account_id) const override;
24 void UpdateAuthError(const std::string& account_id,
25 const GoogleServiceAuthError& error) override;
26
27 std::vector<std::string> GetAccounts() override;
28 void RevokeAllCredentials() override;
29
30 // Overriden to make sure it works on iOS.
31 void LoadCredentials(const std::string& primary_account_id) override;
32
33 // Overriden to make sure it works on Android. Simply calls
34 // IssueRefreshToken().
35 void UpdateCredentials(const std::string& account_id,
36 const std::string& refresh_token) override;
37
38 net::URLRequestContextGetter* GetRequestContext() const override;
39
40 void IssueRefreshToken(const std::string& token);
41 void IssueRefreshTokenForUser(const std::string& account_id,
42 const std::string& token);
43 void IssueAllRefreshTokensLoaded();
44
45 private:
46 // Maps account ids to their refresh token strings.
47 std::map<std::string, std::string> refresh_tokens_;
48
49 DISALLOW_COPY_AND_ASSIGN(FakeProfileOAuth2TokenServiceDelegate);
50 };
51
52 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698