Index: chrome/browser/autofill/credit_card.cc |
=================================================================== |
--- chrome/browser/autofill/credit_card.cc (revision 54215) |
+++ chrome/browser/autofill/credit_card.cc (working copy) |
@@ -306,6 +306,7 @@ |
} |
// Use the Luhn formula to validate the number. |
+// static |
bool CreditCard::IsCreditCardNumber(const string16& text) { |
string16 number; |
RemoveChars(text, kCreditCardSeparators.c_str(), &number); |
@@ -330,6 +331,13 @@ |
return (sum % 10) == 0; |
} |
+bool CreditCard::IsEmpty() const { |
+ FieldTypeSet types; |
+ GetAvailableFieldTypes(&types); |
+ return types.empty() && billing_address().empty(); |
+} |
+ |
+ |
string16 CreditCard::ExpirationMonthAsString() const { |
if (expiration_month_ == 0) |
return string16(); |