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

Unified Diff: chrome/browser/autofill/wallet/wallet_data_retriever.h

Issue 11293078: Integrating Online Wallet into Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes from Dane's review Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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;
+
+class WalletDataRetriever {
+ public:
+ class Delegate {
+ public:
+ // Invoked on response to AcceptLegalDocuments request.
+ virtual void OnAcceptLegalDocuments() = 0;
+ // Invoked on reponse to encrypt otp request.
+ 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
+ // 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,
+ const std::string& google_transaction_id,
+ Delegate* delegate);
+ void EncryptOtp(const void* otp, size_t length, Delegate* delegate);
+ 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_

Powered by Google App Engine
This is Rietveld 408576698