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

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

Issue 1030073003: Autofill: Better recognize credit card type fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 9 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"
(...skipping 22 matching lines...) Expand all
33 33
34 // Returns true if |scanner| points to a field that looks like a month 34 // Returns true if |scanner| points to a field that looks like a month
35 // <select>. 35 // <select>.
36 static bool LikelyCardMonthSelectField(AutofillScanner* scanner); 36 static bool LikelyCardMonthSelectField(AutofillScanner* scanner);
37 37
38 // Returns true if |scanner| points to a field that looks like a year 38 // Returns true if |scanner| points to a field that looks like a year
39 // <select> for a credit card. i.e. it contains the current year and 39 // <select> for a credit card. i.e. it contains the current year and
40 // the next few years. 40 // the next few years.
41 static bool LikelyCardYearSelectField(AutofillScanner* scanner); 41 static bool LikelyCardYearSelectField(AutofillScanner* scanner);
42 42
43 // Returns true if |scanner| points to a <select> field that contains credit
44 // card type options.
45 static bool LikelyCardTypeSelectField(AutofillScanner* scanner);
46
43 CreditCardField(); 47 CreditCardField();
44 48
45 // Parses the expiration month/year/date fields. Returns true if it finds 49 // Parses the expiration month/year/date fields. Returns true if it finds
46 // something new. 50 // something new.
47 bool ParseExpirationDate(AutofillScanner* scanner); 51 bool ParseExpirationDate(AutofillScanner* scanner);
48 52
49 // For the combined expiration field we return |exp_year_type_|; otherwise if 53 // For the combined expiration field we return |exp_year_type_|; otherwise if
50 // |expiration_year_| is having year with |max_length| of 2-digits we return 54 // |expiration_year_| is having year with |max_length| of 2-digits we return
51 // |CREDIT_CARD_EXP_2_DIGIT_YEAR|; otherwise |CREDIT_CARD_EXP_4_DIGIT_YEAR|. 55 // |CREDIT_CARD_EXP_2_DIGIT_YEAR|; otherwise |CREDIT_CARD_EXP_4_DIGIT_YEAR|.
52 ServerFieldType GetExpirationYearType() const; 56 ServerFieldType GetExpirationYearType() const;
(...skipping 25 matching lines...) Expand all
78 // |CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR|; otherwise we store 82 // |CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR|; otherwise we store
79 // |CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR|. 83 // |CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR|.
80 ServerFieldType exp_year_type_; 84 ServerFieldType exp_year_type_;
81 85
82 DISALLOW_COPY_AND_ASSIGN(CreditCardField); 86 DISALLOW_COPY_AND_ASSIGN(CreditCardField);
83 }; 87 };
84 88
85 } // namespace autofill 89 } // namespace autofill
86 90
87 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_FIELD_H_ 91 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_FIELD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698