Chromium Code Reviews| 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_ |