Chromium Code Reviews| Index: chrome/browser/autofill/wallet/wallet_data_retriever.h |
| diff --git a/chrome/browser/autofill/wallet/wallet_data_retriever.h b/chrome/browser/autofill/wallet/wallet_data_retriever.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d69fb577489ba5fcd1cf0871231be570f62d355d |
| --- /dev/null |
| +++ b/chrome/browser/autofill/wallet/wallet_data_retriever.h |
| @@ -0,0 +1,78 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_AUTOFILL_WALLET_WALLET_DATA_RETRIEVER_H_ |
| +#define CHROME_BROWSER_AUTOFILL_WALLET_WALLET_DATA_RETRIEVER_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/memory/ref_counted.h" |
| + |
| +namespace net { |
| +class URLRequestContextGetter; |
| +} |
| + |
| +namespace wallet { |
| + |
| +class Address; |
| +class Cart; |
| +class FullWallet; |
| +class WalletItems; |
| + |
|
Dan Beam
2012/12/01 01:19:49
darth dan finds your lack of comments disturbing
ahutter
2012/12/01 04:06:51
Added a number of comments.
|
| +class WalletDataRetriever { |
| + public: |
| + class Delegate { |
| + public: |
| + // Invoked on response to AcceptLegalDocuments request. |
|
Dan Beam
2012/11/30 19:55:52
nit: all these comments read a bit strangely to me
ahutter
2012/12/01 04:06:51
Done.
|
| + virtual void OnAcceptLegalDocuments() = 0; |
|
Dan Beam
2012/11/30 19:55:52
nit: \n after each method with a description
ahutter
2012/12/01 04:06:51
Done.
|
| + // Invoked on reponse to encrypt otp request. |
|
Dan Beam
2012/11/30 19:55:52
nit: s/abbr/ABBR/ in comments, IMO (i.e. OTP inste
ahutter
2012/12/01 04:06:51
Done.
|
| + virtual void OnEncryptOtp(const std::string& encrypted_otp, |
| + const std::string& session_material) = 0; |
| + // Invoked on successful response to GetFullWallet request. |
| + virtual void OnGetFullWallet(FullWallet* full_wallet) = 0; |
| + // Invoked on successful response to GetWalletItems request. |
| + virtual void OnGetWalletItems(WalletItems* wallet_items) = 0; |
| + // Invoked on response to SendExtendedAutofillStatus request. |
| + virtual void OnSendExtendedAutofillStatus() = 0; |
| + // Invoked when there is a Wallet error with the request |
| + virtual void OnWalletError() = 0; |
| + // Invoked when there is a network erro or upon receiving an invalid |
|
Dan Beam
2012/11/30 19:55:52
s/erro/error/
ahutter
2012/12/01 04:06:51
Done.
|
| + // response. |
| + virtual void OnNetworkError(int response_code) = 0; |
| + |
| + protected: |
| + virtual ~Delegate() {} |
| + }; |
| + explicit WalletDataRetriever(net::URLRequestContextGetter* context_getter); |
| + ~WalletDataRetriever(); |
| + |
| + void AcceptLegalDocuments(const std::vector<std::string> document_ids, |
|
Albert Bodenhamer
2012/11/30 18:14:07
Since other code will call into this it would be g
ahutter
2012/12/01 04:06:51
Done.
|
| + const std::string& google_transaction_id, |
| + Delegate* delegate); |
| + void EncryptOtp(const void* otp, size_t length, Delegate* delegate); |
|
Dan Beam
2012/11/30 19:55:52
add doc comments
ahutter
2012/12/01 04:06:51
Done.
|
| + void GetFullWallet(const std::string& instrument_id, |
| + const std::string& address_id, |
| + const std::string& merchant_domain, |
| + const Cart& cart, |
| + const std::string& google_transaction_id, |
| + const std::string& encrypted_otp, |
| + const std::string& session_material, |
| + Delegate* delegate); |
| + void GetWalletItems(Delegate* delegate); |
| + void SendExtendedAutofillStatus(bool success, |
| + const std::string& merchant_domain, |
| + const std::string& reason, |
| + const std::string& google_transaction_id, |
| + Delegate* delegate); |
| + |
| + private: |
| + class Core; |
| + scoped_refptr<Core> core_; |
| + DISALLOW_COPY_AND_ASSIGN(WalletDataRetriever); |
| +}; |
| + |
| +} // end wallet namespace |
| + |
| +#endif // CHROME_BROWSER_AUTOFILL_WALLET_WALLET_DATA_RETRIEVER_H_ |