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

Unified Diff: components/autofill/content/browser/wallet/full_wallet.cc

Issue 21928004: Add a FullWallet constructor for data obtained from SDK. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months 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: components/autofill/content/browser/wallet/full_wallet.cc
diff --git a/components/autofill/content/browser/wallet/full_wallet.cc b/components/autofill/content/browser/wallet/full_wallet.cc
index 28c47b31cc9e3326da4d8cc3404a0ac6c1989430..f66b28a98577da9ecde0e7e385e4fc00411d4345 100644
--- a/components/autofill/content/browser/wallet/full_wallet.cc
+++ b/components/autofill/content/browser/wallet/full_wallet.cc
@@ -42,6 +42,7 @@ FullWallet::FullWallet(int expiration_month,
FullWallet::~FullWallet() {}
+// static
scoped_ptr<FullWallet>
FullWallet::CreateFullWallet(const DictionaryValue& dictionary) {
const ListValue* required_actions_list;
@@ -127,6 +128,32 @@ scoped_ptr<FullWallet>
required_actions));
}
+// static
+scoped_ptr<FullWallet>
+ FullWallet::CreateFullWalletFromClearText(
+ int expiration_month,
+ int expiration_year,
+ const std::string& pan,
+ const std::string& cvn,
+ scoped_ptr<Address> billing_address,
+ scoped_ptr<Address> shipping_address) {
+ DCHECK(billing_address);
+ DCHECK(!pan.empty());
+ DCHECK(!cvn.empty());
+
+ scoped_ptr<FullWallet> wallet(new FullWallet(
+ expiration_month,
+ expiration_year,
+ std::string(), // no iin -- clear text pan/cvn are set below.
+ std::string(), // no encrypted_rest -- clear text pan/cvn are set below.
+ billing_address.Pass(),
+ shipping_address.Pass(),
+ std::vector<RequiredAction>())); // no required actions in clear text.
+ wallet->pan_ = pan;
+ wallet->cvn_ = cvn;
+ return wallet.Pass();
+}
+
base::string16 FullWallet::GetInfo(const AutofillType& type) {
switch (type.GetStorableType()) {
case CREDIT_CARD_NUMBER:

Powered by Google App Engine
This is Rietveld 408576698