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

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

Issue 137723008: Remove DataModelWrapper from android build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 11 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 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();

Powered by Google App Engine
This is Rietveld 408576698