OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BROWSER_CREDIT_CARD_H_ | 5 #ifndef COMPONENTS_AUTOFILL_BROWSER_CREDIT_CARD_H_ |
6 #define COMPONENTS_AUTOFILL_BROWSER_CREDIT_CARD_H_ | 6 #define COMPONENTS_AUTOFILL_BROWSER_CREDIT_CARD_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 28 matching lines...) Expand all Loading... |
39 virtual string16 GetRawInfo(AutofillFieldType type) const OVERRIDE; | 39 virtual string16 GetRawInfo(AutofillFieldType type) const OVERRIDE; |
40 virtual void SetRawInfo(AutofillFieldType type, | 40 virtual void SetRawInfo(AutofillFieldType type, |
41 const string16& value) OVERRIDE; | 41 const string16& value) OVERRIDE; |
42 virtual string16 GetInfo(AutofillFieldType type, | 42 virtual string16 GetInfo(AutofillFieldType type, |
43 const std::string& app_locale) const OVERRIDE; | 43 const std::string& app_locale) const OVERRIDE; |
44 virtual bool SetInfo(AutofillFieldType type, | 44 virtual bool SetInfo(AutofillFieldType type, |
45 const string16& value, | 45 const string16& value, |
46 const std::string& app_locale) OVERRIDE; | 46 const std::string& app_locale) OVERRIDE; |
47 virtual void FillFormField(const AutofillField& field, | 47 virtual void FillFormField(const AutofillField& field, |
48 size_t variant, | 48 size_t variant, |
| 49 const std::string& app_locale, |
49 FormFieldData* field_data) const OVERRIDE; | 50 FormFieldData* field_data) const OVERRIDE; |
50 | 51 |
51 // Credit card preview summary, for example: ******1234, Exp: 01/2020 | 52 // Credit card preview summary, for example: ******1234, Exp: 01/2020 |
52 const string16 Label() const; | 53 const string16 Label() const; |
53 | 54 |
54 // Special method to set value for HTML5 month input type. | 55 // Special method to set value for HTML5 month input type. |
55 void SetInfoForMonthInputType(const string16& value); | 56 void SetInfoForMonthInputType(const string16& value); |
56 | 57 |
57 // The number altered for display, for example: ******1234 | 58 // The number altered for display, for example: ******1234 |
58 string16 ObfuscatedNumber() const; | 59 string16 ObfuscatedNumber() const; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // textual contents of the fields. | 91 // textual contents of the fields. |
91 // GUIDs, labels, and unique IDs are not compared, only the values of the | 92 // GUIDs, labels, and unique IDs are not compared, only the values of the |
92 // credit cards themselves. | 93 // credit cards themselves. |
93 int Compare(const CreditCard& credit_card) const; | 94 int Compare(const CreditCard& credit_card) const; |
94 | 95 |
95 // Used by tests. | 96 // Used by tests. |
96 bool operator==(const CreditCard& credit_card) const; | 97 bool operator==(const CreditCard& credit_card) const; |
97 bool operator!=(const CreditCard& credit_card) const; | 98 bool operator!=(const CreditCard& credit_card) const; |
98 | 99 |
99 // Returns true if there are no values (field types) set. | 100 // Returns true if there are no values (field types) set. |
100 bool IsEmpty() const; | 101 bool IsEmpty(const std::string& app_locale) const; |
101 | 102 |
102 // Returns true if all field types have valid values set. | 103 // Returns true if all field types have valid values set. |
103 bool IsComplete() const; | 104 bool IsComplete() const; |
104 | 105 |
105 // Returns the credit card number. | 106 // Returns the credit card number. |
106 const string16& number() const { return number_; } | 107 const string16& number() const { return number_; } |
107 | 108 |
108 private: | 109 private: |
109 // FormGroup: | 110 // FormGroup: |
110 virtual void GetSupportedTypes(FieldTypeSet* supported_types) const OVERRIDE; | 111 virtual void GetSupportedTypes(FieldTypeSet* supported_types) const OVERRIDE; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 extern const char* const kAmericanExpressCard; | 151 extern const char* const kAmericanExpressCard; |
151 extern const char* const kDinersCard; | 152 extern const char* const kDinersCard; |
152 extern const char* const kDiscoverCard; | 153 extern const char* const kDiscoverCard; |
153 extern const char* const kGenericCard; | 154 extern const char* const kGenericCard; |
154 extern const char* const kJCBCard; | 155 extern const char* const kJCBCard; |
155 extern const char* const kMasterCard; | 156 extern const char* const kMasterCard; |
156 extern const char* const kSoloCard; | 157 extern const char* const kSoloCard; |
157 extern const char* const kVisaCard; | 158 extern const char* const kVisaCard; |
158 | 159 |
159 #endif // COMPONENTS_AUTOFILL_BROWSER_CREDIT_CARD_H_ | 160 #endif // COMPONENTS_AUTOFILL_BROWSER_CREDIT_CARD_H_ |
OLD | NEW |