Chromium Code Reviews| 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 0a7fef67e6f70df846b65534f8811105fc501ff5..7ccb9c30cdede5a023d8b8b368c7c79c97145468 100644 |
| --- a/components/autofill/content/browser/wallet/full_wallet.cc |
| +++ b/components/autofill/content/browser/wallet/full_wallet.cc |
| @@ -41,6 +41,7 @@ FullWallet::FullWallet(int expiration_month, |
| FullWallet::~FullWallet() {} |
| +// static |
| scoped_ptr<FullWallet> |
| FullWallet::CreateFullWallet(const DictionaryValue& dictionary) { |
| const ListValue* required_actions_list; |
| @@ -126,6 +127,33 @@ 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(), |
| + std::string(), |
| + billing_address.Pass(), |
| + shipping_address.Pass(), |
| + std::vector<RequiredAction>())); |
|
Dan Beam
2013/08/06 03:38:17
nit: this seems to fit in 80 cols like this:
sc
Dan Beam
2013/08/06 03:38:17
are you sure this can never has required actions?
aruslan
2013/08/07 18:21:16
Done.
aruslan
2013/08/07 18:21:16
Yes -- this is a final (non-negotiable) response;
|
| + wallet->pan_ = pan; |
| + wallet->cvn_ = cvn; |
|
Dan Beam
2013/08/06 03:38:17
this is kind of nasty...
aruslan
2013/08/07 18:21:16
Another option was to add a new constructor, and i
|
| + return wallet.Pass(); |
| +} |
| + |
| base::string16 FullWallet::GetInfo(AutofillFieldType type) { |
| switch (type) { |
| case CREDIT_CARD_NUMBER: |