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 d4b390ada82c01641106c6e3f6ea5ca3e7e85a5f..b9cfb1c4ebb5bcbf4e42432fb1e7aa507c7dbd09 100644 |
| --- a/components/autofill/content/browser/wallet/full_wallet.cc |
| +++ b/components/autofill/content/browser/wallet/full_wallet.cc |
| @@ -154,7 +154,8 @@ scoped_ptr<FullWallet> |
| return wallet.Pass(); |
| } |
| -base::string16 FullWallet::GetInfo(const AutofillType& type) { |
| +base::string16 FullWallet::GetBillingInfo(const std::string& app_locale, |
| + const AutofillType& type) { |
|
Dan Beam
2014/01/27 19:37:50
nit: reverse the order of |app_locale| and |type|
Evan Stade
2014/01/27 19:45:41
can't, this is needed for the bind() to work
|
| switch (type.GetStorableType()) { |
| case CREDIT_CARD_NUMBER: |
| return base::UTF8ToUTF16(GetPan()); |
|
Dan Beam
2014/01/27 19:37:50
nit: base::ASCIIToUTF16() if you assume CVN/PAN ca
Evan Stade
2014/01/27 19:45:41
Done.
|
| @@ -201,10 +202,14 @@ base::string16 FullWallet::GetInfo(const AutofillType& type) { |
| } |
| default: |
| - NOTREACHED(); |
| + DCHECK_NE(CREDIT_CARD, type.group()); |
| + return billing_address_->GetInfo(type, app_locale); |
| } |
| +} |
| - return base::string16(); |
| +base::string16 FullWallet::GetShippingInfo(const std::string& app_locale, |
| + const AutofillType& type) { |
| + return shipping_address_->GetInfo(type, app_locale); |
| } |
| bool FullWallet::HasRequiredAction(RequiredAction action) const { |
| @@ -216,11 +221,16 @@ bool FullWallet::HasRequiredAction(RequiredAction action) const { |
| base::string16 FullWallet::TypeAndLastFourDigits() { |
| CreditCard card; |
| - card.SetRawInfo(CREDIT_CARD_NUMBER, |
| - GetInfo(AutofillType(CREDIT_CARD_NUMBER))); |
| + card.SetRawInfo(CREDIT_CARD_NUMBER, base::ASCIIToUTF16(GetPan())); |
| return card.TypeAndLastFourDigits(); |
| } |
| +const std::string& FullWallet::GetPan() { |
| + if (pan_.empty()) |
| + DecryptCardInfo(); |
| + return pan_; |
| +} |
| + |
| bool FullWallet::operator==(const FullWallet& other) const { |
| if (expiration_month_ != other.expiration_month_) |
| return false; |
| @@ -307,12 +317,6 @@ void FullWallet::DecryptCardInfo() { |
| pan_ = iin_ + card_info.substr(0, split); |
| } |
| -const std::string& FullWallet::GetPan() { |
| - if (pan_.empty()) |
| - DecryptCardInfo(); |
| - return pan_; |
| -} |
| - |
| const std::string& FullWallet::GetCvn() { |
| if (cvn_.empty()) |
| DecryptCardInfo(); |