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

Unified Diff: chrome/browser/autofill/credit_card.cc

Issue 3061001: AutoFill Empty profiles should not be saved from AutoFillDialog Add and Edit sheets on Mac. (Closed)
Patch Set: Move to member function and functor instead of static method. Created 10 years, 5 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
« no previous file with comments | « chrome/browser/autofill/credit_card.h ('k') | chrome/browser/autofill/personal_data_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/credit_card.cc
diff --git a/chrome/browser/autofill/credit_card.cc b/chrome/browser/autofill/credit_card.cc
index 4a9483efae9e83fa69fcb1112be808f697bc57ac..de2a740824ed61001f05d6804fdcede9666785f4 100644
--- a/chrome/browser/autofill/credit_card.cc
+++ b/chrome/browser/autofill/credit_card.cc
@@ -306,6 +306,7 @@ bool CreditCard::operator!=(const CreditCard& creditcard) const {
}
// 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 @@ bool CreditCard::IsCreditCardNumber(const string16& text) {
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();
« no previous file with comments | « chrome/browser/autofill/credit_card.h ('k') | chrome/browser/autofill/personal_data_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698