OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 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_AUTOFILL_WALLET_WALLET_DATA_RETRIEVER_H_ |
| 6 #define CHROME_BROWSER_AUTOFILL_WALLET_WALLET_DATA_RETRIEVER_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/memory/ref_counted.h" |
| 12 |
| 13 namespace net { |
| 14 class URLRequestContextGetter; |
| 15 } |
| 16 |
| 17 namespace wallet { |
| 18 |
| 19 class Address; |
| 20 class Cart; |
| 21 class FullWallet; |
| 22 class WalletItems; |
| 23 |
| 24 class WalletDataRetriever { |
| 25 public: |
| 26 class Delegate { |
| 27 public: |
| 28 // Invoked on response to AcceptLegalDocuments request. |
| 29 virtual void OnAcceptLegalDocuments() = 0; |
| 30 // Invoked on reponse to encrypt otp request. |
| 31 virtual void OnEncryptOtp(const std::string& encrypted_otp, |
| 32 const std::string& session_material) = 0; |
| 33 // Invoked on successful response to GetFullWallet request. |
| 34 virtual void OnGetFullWallet(FullWallet* full_wallet) = 0; |
| 35 // Invoked on successful response to GetWalletItems request. |
| 36 virtual void OnGetWalletItems(WalletItems* wallet_items) = 0; |
| 37 // Invoked on response to SendExtendedAutofillStatus request. |
| 38 virtual void OnSendExtendedAutofillStatus() = 0; |
| 39 // Invoked when there is a Wallet error with the request |
| 40 virtual void OnWalletError() = 0; |
| 41 // Invoked when there is a network erro or upon receiving an invalid |
| 42 // response. |
| 43 virtual void OnNetworkError(int response_code) = 0; |
| 44 |
| 45 protected: |
| 46 virtual ~Delegate() {} |
| 47 }; |
| 48 explicit WalletDataRetriever(net::URLRequestContextGetter* context_getter); |
| 49 ~WalletDataRetriever(); |
| 50 |
| 51 void AcceptLegalDocuments(const std::vector<std::string> document_ids, |
| 52 const std::string& google_transaction_id, |
| 53 Delegate* delegate); |
| 54 void EncryptOtp(const void* otp, size_t length, Delegate* delegate); |
| 55 void GetFullWallet(const std::string& instrument_id, |
| 56 const std::string& address_id, |
| 57 const std::string& merchant_domain, |
| 58 const Cart& cart, |
| 59 const std::string& google_transaction_id, |
| 60 const std::string& encrypted_otp, |
| 61 const std::string& session_material, |
| 62 Delegate* delegate); |
| 63 void GetWalletItems(Delegate* delegate); |
| 64 void SendExtendedAutofillStatus(bool success, |
| 65 const std::string& merchant_domain, |
| 66 const std::string& reason, |
| 67 const std::string& google_transaction_id, |
| 68 Delegate* delegate); |
| 69 |
| 70 private: |
| 71 class Core; |
| 72 scoped_refptr<Core> core_; |
| 73 DISALLOW_COPY_AND_ASSIGN(WalletDataRetriever); |
| 74 }; |
| 75 |
| 76 } // end wallet namespace |
| 77 |
| 78 #endif // CHROME_BROWSER_AUTOFILL_WALLET_WALLET_DATA_RETRIEVER_H_ |
OLD | NEW |