| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_FIELD_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_FIELD_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_FIELD_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_FIELD_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 // Parses the expiration month/year/date fields. Returns true if it finds | 53 // Parses the expiration month/year/date fields. Returns true if it finds |
| 54 // something new. | 54 // something new. |
| 55 bool ParseExpirationDate(AutofillScanner* scanner); | 55 bool ParseExpirationDate(AutofillScanner* scanner); |
| 56 | 56 |
| 57 // For the combined expiration field we return |exp_year_type_|; otherwise if | 57 // For the combined expiration field we return |exp_year_type_|; otherwise if |
| 58 // |expiration_year_| is having year with |max_length| of 2-digits we return | 58 // |expiration_year_| is having year with |max_length| of 2-digits we return |
| 59 // |CREDIT_CARD_EXP_2_DIGIT_YEAR|; otherwise |CREDIT_CARD_EXP_4_DIGIT_YEAR|. | 59 // |CREDIT_CARD_EXP_2_DIGIT_YEAR|; otherwise |CREDIT_CARD_EXP_4_DIGIT_YEAR|. |
| 60 ServerFieldType GetExpirationYearType() const; | 60 ServerFieldType GetExpirationYearType() const; |
| 61 | 61 |
| 62 // Returns whether the expiration has been set for this credit card field. |
| 63 // It can be either a date or both the month and the year. |
| 64 bool HasExpiration() const; |
| 65 |
| 62 AutofillField* cardholder_; // Optional. | 66 AutofillField* cardholder_; // Optional. |
| 63 | 67 |
| 64 // Occasionally pages have separate fields for the cardholder's first and | 68 // Occasionally pages have separate fields for the cardholder's first and |
| 65 // last names; for such pages |cardholder_| holds the first name field and | 69 // last names; for such pages |cardholder_| holds the first name field and |
| 66 // we store the last name field here. | 70 // we store the last name field here. |
| 67 // (We could store an embedded |NameField| object here, but we don't do so | 71 // (We could store an embedded |NameField| object here, but we don't do so |
| 68 // because the text patterns for matching a cardholder name are different | 72 // because the text patterns for matching a cardholder name are different |
| 69 // than for ordinary names, and because cardholder names never have titles, | 73 // than for ordinary names, and because cardholder names never have titles, |
| 70 // middle names or suffixes.) | 74 // middle names or suffixes.) |
| 71 AutofillField* cardholder_last_; | 75 AutofillField* cardholder_last_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 86 // |CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR|; otherwise we store | 90 // |CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR|; otherwise we store |
| 87 // |CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR|. | 91 // |CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR|. |
| 88 ServerFieldType exp_year_type_; | 92 ServerFieldType exp_year_type_; |
| 89 | 93 |
| 90 DISALLOW_COPY_AND_ASSIGN(CreditCardField); | 94 DISALLOW_COPY_AND_ASSIGN(CreditCardField); |
| 91 }; | 95 }; |
| 92 | 96 |
| 93 } // namespace autofill | 97 } // namespace autofill |
| 94 | 98 |
| 95 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_FIELD_H_ | 99 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_FIELD_H_ |
| OLD | NEW |