| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_AUTOFILL_CREDIT_CARD_FIELD_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_CREDIT_CARD_FIELD_H_ |
| 6 #define CHROME_BROWSER_AUTOFILL_CREDIT_CARD_FIELD_H_ | 6 #define CHROME_BROWSER_AUTOFILL_CREDIT_CARD_FIELD_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "chrome/browser/autofill/autofill_type.h" | 14 #include "chrome/browser/autofill/autofill_type.h" |
| 15 #include "chrome/browser/autofill/form_field.h" | 15 #include "chrome/browser/autofill/form_field.h" |
| 16 | 16 |
| 17 class AutofillField; | 17 class AutofillField; |
| 18 class AutofillScanner; | 18 class AutofillScanner; |
| 19 | 19 |
| 20 class CreditCardField : public FormField { | 20 class CreditCardField : public FormField { |
| 21 public: | 21 public: |
| 22 static FormField* Parse(AutofillScanner* scanner, bool is_ecml); | 22 static FormField* Parse(AutofillScanner* scanner); |
| 23 | 23 |
| 24 protected: | 24 protected: |
| 25 // FormField: | 25 // FormField: |
| 26 virtual bool ClassifyField(FieldTypeMap* map) const OVERRIDE; | 26 virtual bool ClassifyField(FieldTypeMap* map) const OVERRIDE; |
| 27 | 27 |
| 28 private: | 28 private: |
| 29 FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, ParseMiniumCreditCard); | 29 FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, ParseMiniumCreditCard); |
| 30 FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, ParseMiniumCreditCardEcml); | |
| 31 FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, ParseFullCreditCard); | 30 FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, ParseFullCreditCard); |
| 32 FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, ParseFullCreditCardEcml); | |
| 33 FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, ParseExpMonthYear); | 31 FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, ParseExpMonthYear); |
| 34 FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, ParseExpMonthYear2); | 32 FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, ParseExpMonthYear2); |
| 35 FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, | 33 FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, |
| 36 ParseCreditCardHolderNameWithCCFullName); | 34 ParseCreditCardHolderNameWithCCFullName); |
| 37 | 35 |
| 38 CreditCardField(); | 36 CreditCardField(); |
| 39 | 37 |
| 40 const AutofillField* cardholder_; // Optional. | 38 const AutofillField* cardholder_; // Optional. |
| 41 | 39 |
| 42 // Occasionally pages have separate fields for the cardholder's first and | 40 // Occasionally pages have separate fields for the cardholder's first and |
| (...skipping 13 matching lines...) Expand all Loading... |
| 56 const AutofillField* verification_; | 54 const AutofillField* verification_; |
| 57 | 55 |
| 58 // Both required. TODO(jhawkins): Parse the select control. | 56 // Both required. TODO(jhawkins): Parse the select control. |
| 59 const AutofillField* expiration_month_; | 57 const AutofillField* expiration_month_; |
| 60 const AutofillField* expiration_year_; | 58 const AutofillField* expiration_year_; |
| 61 | 59 |
| 62 DISALLOW_COPY_AND_ASSIGN(CreditCardField); | 60 DISALLOW_COPY_AND_ASSIGN(CreditCardField); |
| 63 }; | 61 }; |
| 64 | 62 |
| 65 #endif // CHROME_BROWSER_AUTOFILL_CREDIT_CARD_FIELD_H_ | 63 #endif // CHROME_BROWSER_AUTOFILL_CREDIT_CARD_FIELD_H_ |
| OLD | NEW |