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

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

Issue 493393003: [Autofill] Autofill incorrectly fills credit card expiration year in 2-digit fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated review comments and code indentation. Created 6 years, 4 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
« no previous file with comments | « no previous file | components/autofill/core/browser/credit_card_field.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 13 matching lines...) Expand all
24 24
25 protected: 25 protected:
26 // FormField: 26 // FormField:
27 virtual bool ClassifyField(ServerFieldTypeMap* map) const OVERRIDE; 27 virtual bool ClassifyField(ServerFieldTypeMap* map) const OVERRIDE;
28 28
29 private: 29 private:
30 friend class CreditCardFieldTest; 30 friend class CreditCardFieldTest;
31 31
32 CreditCardField(); 32 CreditCardField();
33 33
34 // For the combined expiration field we return |exp_year_type_|; otherwise if
35 // |expiration_year_| is having year with |max_length| of 2-digits we return
36 // |CREDIT_CARD_EXP_2_DIGIT_YEAR|; otherwise |CREDIT_CARD_EXP_4_DIGIT_YEAR|.
37 ServerFieldType GetExpirationYearType() const;
38
34 const AutofillField* cardholder_; // Optional. 39 const AutofillField* cardholder_; // Optional.
35 40
36 // Occasionally pages have separate fields for the cardholder's first and 41 // Occasionally pages have separate fields for the cardholder's first and
37 // last names; for such pages cardholder_ holds the first name field and 42 // last names; for such pages |cardholder_| holds the first name field and
38 // we store the last name field here. 43 // we store the last name field here.
39 // (We could store an embedded NameField object here, but we don't do so 44 // (We could store an embedded |NameField| object here, but we don't do so
40 // because the text patterns for matching a cardholder name are different 45 // because the text patterns for matching a cardholder name are different
41 // than for ordinary names, and because cardholder names never have titles, 46 // than for ordinary names, and because cardholder names never have titles,
42 // middle names or suffixes.) 47 // middle names or suffixes.)
43 const AutofillField* cardholder_last_; 48 const AutofillField* cardholder_last_;
44 49
45 // TODO(jhawkins): Parse the select control. 50 // TODO(jhawkins): Parse the select control.
46 const AutofillField* type_; // Optional. 51 const AutofillField* type_; // Optional.
47 const AutofillField* number_; // Required. 52 const AutofillField* number_; // Required.
48 53
49 // The 3-digit card verification number; we don't currently fill this. 54 // The 3-digit card verification number; we don't currently fill this.
50 const AutofillField* verification_; 55 const AutofillField* verification_;
51 56
52 // Either |expiration_date_| or both |expiration_month_| and 57 // Either |expiration_date_| or both |expiration_month_| and
53 // |expiration_year_| are required. 58 // |expiration_year_| are required.
54 const AutofillField* expiration_month_; 59 const AutofillField* expiration_month_;
55 const AutofillField* expiration_year_; 60 const AutofillField* expiration_year_;
56 const AutofillField* expiration_date_; 61 const AutofillField* expiration_date_;
57 62
58 // True if the year is detected to be a 2-digit year; otherwise, we assume 63 // For combined expiration field having year as 2-digits we store here
59 // a 4-digit year. 64 // |CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR|; otherwise we store
60 bool is_two_digit_year_; 65 // |CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR|.
66 ServerFieldType exp_year_type_;
61 67
62 DISALLOW_COPY_AND_ASSIGN(CreditCardField); 68 DISALLOW_COPY_AND_ASSIGN(CreditCardField);
63 }; 69 };
64 70
65 } // namespace autofill 71 } // namespace autofill
66 72
67 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_FIELD_H_ 73 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_FIELD_H_
OLDNEW
« no previous file with comments | « no previous file | components/autofill/core/browser/credit_card_field.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698