Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(593)

Side by Side Diff: components/autofill/core/browser/credit_card_field.h

Issue 853523004: Autofill: Set requirements for number of recognized fields in an autofillable form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More relaxed check for form tag Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/gtest_prod_util.h" 12 #include "base/gtest_prod_util.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "components/autofill/core/browser/autofill_type.h" 14 #include "components/autofill/core/browser/autofill_type.h"
15 #include "components/autofill/core/browser/form_field.h" 15 #include "components/autofill/core/browser/form_field.h"
16 16
17 namespace autofill { 17 namespace autofill {
18 18
19 class AutofillField; 19 class AutofillField;
20 class AutofillScanner; 20 class AutofillScanner;
21 21
22 class CreditCardField : public FormField { 22 class CreditCardField : public FormField {
23 public: 23 public:
24 ~CreditCardField() override; 24 ~CreditCardField() override;
25 static scoped_ptr<FormField> Parse(AutofillScanner* scanner); 25 static scoped_ptr<FormField> Parse(AutofillScanner* scanner);
26 26
27 protected: 27 protected:
28 // FormField: 28 // FormField:
29 bool ClassifyField(ServerFieldTypeMap* map) const override; 29 bool ClassifyField(ServerFieldTypeMap* map) const override;
30 size_t FieldCount() const override;
30 31
31 private: 32 private:
32 friend class CreditCardFieldTest; 33 friend class CreditCardFieldTest;
33 34
34 CreditCardField(); 35 CreditCardField();
35 36
36 // For the combined expiration field we return |exp_year_type_|; otherwise if 37 // For the combined expiration field we return |exp_year_type_|; otherwise if
37 // |expiration_year_| is having year with |max_length| of 2-digits we return 38 // |expiration_year_| is having year with |max_length| of 2-digits we return
38 // |CREDIT_CARD_EXP_2_DIGIT_YEAR|; otherwise |CREDIT_CARD_EXP_4_DIGIT_YEAR|. 39 // |CREDIT_CARD_EXP_2_DIGIT_YEAR|; otherwise |CREDIT_CARD_EXP_4_DIGIT_YEAR|.
39 ServerFieldType GetExpirationYearType() const; 40 ServerFieldType GetExpirationYearType() const;
(...skipping 25 matching lines...) Expand all
65 // |CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR|; otherwise we store 66 // |CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR|; otherwise we store
66 // |CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR|. 67 // |CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR|.
67 ServerFieldType exp_year_type_; 68 ServerFieldType exp_year_type_;
68 69
69 DISALLOW_COPY_AND_ASSIGN(CreditCardField); 70 DISALLOW_COPY_AND_ASSIGN(CreditCardField);
70 }; 71 };
71 72
72 } // namespace autofill 73 } // namespace autofill
73 74
74 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_FIELD_H_ 75 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_FIELD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698