| 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 <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "components/autofill/core/browser/autofill_type.h" | 13 #include "components/autofill/core/browser/autofill_type.h" |
| 14 #include "components/autofill/core/browser/form_field.h" | 14 #include "components/autofill/core/browser/form_field.h" |
| 15 | 15 |
| 16 namespace autofill { | 16 namespace autofill { |
| 17 | 17 |
| 18 class AutofillField; | 18 class AutofillField; |
| 19 class AutofillScanner; | 19 class AutofillScanner; |
| 20 | 20 |
| 21 class CreditCardField : public FormField { | 21 class CreditCardField : public FormField { |
| 22 public: | 22 public: |
| 23 ~CreditCardField() override; | 23 ~CreditCardField() override; |
| 24 static std::unique_ptr<FormField> Parse(AutofillScanner* scanner); | 24 static std::unique_ptr<FormField> Parse(AutofillScanner* scanner); |
| 25 | 25 |
| 26 protected: | 26 protected: |
| 27 void AddClassifications(FieldCandidatesMap* field_candidates) const override; | 27 void AddClassifications(FieldCandidatesMap* field_candidates) const override; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 friend class CreditCardFieldTest; | 30 friend class CreditCardFieldTestBase; |
| 31 | 31 |
| 32 // Returns true if |scanner| points to a field that looks like a month | 32 // Returns true if |scanner| points to a field that looks like a month |
| 33 // <select>. | 33 // <select>. |
| 34 static bool LikelyCardMonthSelectField(AutofillScanner* scanner); | 34 static bool LikelyCardMonthSelectField(AutofillScanner* scanner); |
| 35 | 35 |
| 36 // Returns true if |scanner| points to a field that looks like a year | 36 // Returns true if |scanner| points to a field that looks like a year |
| 37 // <select> for a credit card. i.e. it contains the current year and | 37 // <select> for a credit card. i.e. it contains the current year and |
| 38 // the next few years. | 38 // the next few years. |
| 39 static bool LikelyCardYearSelectField(AutofillScanner* scanner); | 39 static bool LikelyCardYearSelectField(AutofillScanner* scanner); |
| 40 | 40 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // |CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR|; otherwise we store | 90 // |CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR|; otherwise we store |
| 91 // |CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR|. | 91 // |CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR|. |
| 92 ServerFieldType exp_year_type_; | 92 ServerFieldType exp_year_type_; |
| 93 | 93 |
| 94 DISALLOW_COPY_AND_ASSIGN(CreditCardField); | 94 DISALLOW_COPY_AND_ASSIGN(CreditCardField); |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace autofill | 97 } // namespace autofill |
| 98 | 98 |
| 99 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_FIELD_H_ | 99 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_FIELD_H_ |
| OLD | NEW |