summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill/credit_card.cc
diff options
context:
space:
mode:
authorisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-22 04:24:22 +0000
committerisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-22 04:24:22 +0000
commitcdd0d448a7a82e7824c3ef84c9705cadc4d0a8bc (patch)
tree49e7572da37d58d5838f3eda7f00392d023da73d /chrome/browser/autofill/credit_card.cc
parentf7e61316fae89776c8406073b17167fa3e991114 (diff)
downloadchromium_src-cdd0d448a7a82e7824c3ef84c9705cadc4d0a8bc.zip
chromium_src-cdd0d448a7a82e7824c3ef84c9705cadc4d0a8bc.tar.gz
chromium_src-cdd0d448a7a82e7824c3ef84c9705cadc4d0a8bc.tar.bz2
Don't learn credit cards for Autofill if they are missing any data.
BUG=89990 TEST=unit_tests --gtest_filter=PersonalDataManagerTest.AggregateCreditCardWithMissingInfoInNew Review URL: http://codereview.chromium.org/7465019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93548 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/credit_card.cc')
-rw-r--r--chrome/browser/autofill/credit_card.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/autofill/credit_card.cc b/chrome/browser/autofill/credit_card.cc
index a655d84..b6803bc 100644
--- a/chrome/browser/autofill/credit_card.cc
+++ b/chrome/browser/autofill/credit_card.cc
@@ -504,6 +504,14 @@ bool CreditCard::IsEmpty() const {
return types.empty();
}
+bool CreditCard::IsComplete() const {
+ if (!IsValidCreditCardNumber(number_))
+ return false;
+
+ return
+ !name_on_card_.empty() && expiration_month_ != 0 && expiration_year_ != 0;
+}
+
string16 CreditCard::ExpirationMonthAsString() const {
if (expiration_month_ == 0)
return string16();