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

Unified Diff: components/autofill/core/browser/credit_card_field.cc

Issue 853523004: Autofill: Set requirements for number of recognized fields in an autofillable form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More relaxed check for form tag Created 5 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/core/browser/credit_card_field.cc
diff --git a/components/autofill/core/browser/credit_card_field.cc b/components/autofill/core/browser/credit_card_field.cc
index dc0d3e7ecc33feaeb9f62fec925b33044a06b8b0..73cf16bc810f8806a3696199f752f9b5bdabe714 100644
--- a/components/autofill/core/browser/credit_card_field.cc
+++ b/components/autofill/core/browser/credit_card_field.cc
@@ -243,6 +243,28 @@ bool CreditCardField::ClassifyField(ServerFieldTypeMap* map) const {
return ok;
}
+size_t CreditCardField::FieldCount() const {
+ size_t count = 0;
+
+ if (cardholder_)
+ ++count;
+ if (cardholder_last_)
+ ++count;
+ if (type_)
+ ++count;
+ count += numbers_.size();
Evan Stade 2015/01/21 22:52:49 this should probably be if (!numbers_.empty())
Lei Zhang 2015/01/22 08:07:36 Done.
+ if (verification_)
+ ++count;
+ if (expiration_month_)
+ ++count;
+ if (expiration_year_)
+ ++count;
+ if (expiration_date_)
+ ++count;
+
+ return count;;
+}
+
ServerFieldType CreditCardField::GetExpirationYearType() const {
return (expiration_date_
? exp_year_type_

Powered by Google App Engine
This is Rietveld 408576698