• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_AUTOFILL_CREDIT_CARD_FIELD_H_
6 #define CHROME_BROWSER_AUTOFILL_CREDIT_CARD_FIELD_H_
7 #pragma once
8 
9 #include <vector>
10 
11 #include "base/basictypes.h"
12 #include "chrome/browser/autofill/autofill_type.h"
13 #include "chrome/browser/autofill/form_field.h"
14 
15 class AutofillField;
16 
17 class CreditCardField : public FormField {
18  public:
19   // FormField implementation:
20   virtual bool GetFieldInfo(FieldTypeMap* field_type_map) const;
21   virtual FormFieldType GetFormFieldType() const;
22 
23   static CreditCardField* Parse(
24       std::vector<AutofillField*>::const_iterator* iter,
25       bool is_ecml);
26 
27  private:
28   CreditCardField();
29 
30   AutofillField* cardholder_;  // Optional.
31 
32   // Occasionally pages have separate fields for the cardholder's first and
33   // last names; for such pages cardholder_ holds the first name field and
34   // we store the last name field here.
35   // (We could store an embedded NameField object here, but we don't do so
36   // because the text patterns for matching a cardholder name are different
37   // than for ordinary names, and because cardholder names never have titles,
38   // middle names or suffixes.)
39   AutofillField* cardholder_last_;
40 
41   AutofillField* type_;  // Optional.  TODO(jhawkins): Parse the select control.
42   AutofillField* number_;  // Required.
43 
44   // The 3-digit card verification number; we don't currently fill this.
45   AutofillField* verification_;
46 
47   // Both required.  TODO(jhawkins): Parse the select control.
48   AutofillField* expiration_month_;
49   AutofillField* expiration_year_;
50 
51   DISALLOW_COPY_AND_ASSIGN(CreditCardField);
52 };
53 
54 #endif  // CHROME_BROWSER_AUTOFILL_CREDIT_CARD_FIELD_H_
55