Index: components/autofill/core/browser/wallet/real_pan_wallet_client.h |
diff --git a/components/autofill/core/browser/wallet/real_pan_wallet_client.h b/components/autofill/core/browser/wallet/real_pan_wallet_client.h |
index 4331d8cc508237f12edf609a05394eb06d7859b6..82dc0b72d0664d3add9d23e9c63f41bb2892433d 100644 |
--- a/components/autofill/core/browser/wallet/real_pan_wallet_client.h |
+++ b/components/autofill/core/browser/wallet/real_pan_wallet_client.h |
@@ -8,6 +8,7 @@ |
#include "base/memory/ref_counted.h" |
#include "base/memory/weak_ptr.h" |
#include "components/autofill/core/browser/card_unmask_delegate.h" |
+#include "components/autofill/core/browser/credit_card.h" |
#include "google_apis/gaia/oauth2_token_service.h" |
#include "net/url_request/url_fetcher_delegate.h" |
@@ -20,8 +21,6 @@ class URLRequestContextGetter; |
namespace autofill { |
-class CreditCard; |
- |
namespace wallet { |
// RealPanWalletClient is modelled on WalletClient. Whereas the latter is used |
@@ -70,8 +69,11 @@ class RealPanWalletClient : public net::URLFetcherDelegate, |
void OnGetTokenFailure(const OAuth2TokenService::Request* request, |
const GoogleServiceAuthError& error) override; |
+ // Creates |request_| from |card_| and |response_|. |
+ void CreateRequest(); |
+ |
// Initiates a new OAuth2 token request. |
- void StartTokenFetch(); |
+ void StartTokenFetch(bool invalidate_old); |
// Adds the token to |request_| and starts the request. |
void SetOAuth2TokenAndStartRequest(); |
@@ -83,6 +85,10 @@ class RealPanWalletClient : public net::URLFetcherDelegate, |
// of a request to Online Wallet. |
Delegate* const delegate_; // must outlive |this|. |
+ // The card and response for the latest unmask request. |
+ CreditCard card_; |
+ CardUnmaskDelegate::UnmaskResponse response_; |
+ |
// The current Wallet request object. |
scoped_ptr<net::URLFetcher> request_; |
@@ -92,6 +98,9 @@ class RealPanWalletClient : public net::URLFetcherDelegate, |
// The OAuth2 token, or empty if not fetched. |
std::string access_token_; |
+ // True if |this| has already retried due to a 401 response from the server. |
+ bool has_retried_authorization_; |
+ |
base::WeakPtrFactory<RealPanWalletClient> weak_ptr_factory_; |
DISALLOW_COPY_AND_ASSIGN(RealPanWalletClient); |