Index: google_apis/gaia/fake_oauth2_token_service_delegate.h |
diff --git a/google_apis/gaia/fake_oauth2_token_service_delegate.h b/google_apis/gaia/fake_oauth2_token_service_delegate.h |
index d75a22f57286d0025e1d0a5f41eb86f931c67f32..127039ca1bf3d52d43f4f5b4b1c19cf36b673e3a 100644 |
--- a/google_apis/gaia/fake_oauth2_token_service_delegate.h |
+++ b/google_apis/gaia/fake_oauth2_token_service_delegate.h |
@@ -5,6 +5,8 @@ |
#ifndef CHROME_BROWSER_SIGNIN_FAKE_OAUTH2_TOKEN_SERVICE_DELEGATE_H_ |
#define CHROME_BROWSER_SIGNIN_FAKE_OAUTH2_TOKEN_SERVICE_DELEGATE_H_ |
+#include "base/memory/linked_ptr.h" |
+#include "google_apis/gaia/google_service_auth_error.h" |
#include "google_apis/gaia/oauth2_token_service_delegate.h" |
#include "net/url_request/url_request_context_getter.h" |
@@ -20,6 +22,7 @@ class FakeOAuth2TokenServiceDelegate : public OAuth2TokenServiceDelegate { |
// Overriden to make sure it works on Android. |
bool RefreshTokenIsAvailable(const std::string& account_id) const override; |
+ bool RefreshTokenHasError(const std::string& account_id) const override; |
std::vector<std::string> GetAccounts() override; |
void RevokeAllCredentials() override; |
@@ -36,13 +39,24 @@ class FakeOAuth2TokenServiceDelegate : public OAuth2TokenServiceDelegate { |
request_context_ = request_context; |
} |
+ void SetLastErrorForAccount(const std::string& account_id, |
+ const GoogleServiceAuthError& error); |
+ |
private: |
+ struct AccountInfo { |
+ AccountInfo(const std::string& refresh_token); |
+ |
+ const std::string refresh_token; |
+ GoogleServiceAuthError error; |
+ }; |
+ |
void IssueRefreshTokenForUser(const std::string& account_id, |
const std::string& token); |
std::string GetRefreshToken(const std::string& account_id) const; |
- // Maps account ids to their refresh token strings. |
- std::map<std::string, std::string> refresh_tokens_; |
+ // Maps account ids to info. |
+ typedef std::map<std::string, linked_ptr<AccountInfo>> AccountInfoMap; |
+ AccountInfoMap refresh_tokens_; |
scoped_refptr<net::URLRequestContextGetter> request_context_; |