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: |