OLD | NEW |
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_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 const std::string& app_locale) const override; | 94 const std::string& app_locale) const override; |
95 bool SetInfo(const AutofillType& type, | 95 bool SetInfo(const AutofillType& type, |
96 const base::string16& value, | 96 const base::string16& value, |
97 const std::string& app_locale) override; | 97 const std::string& app_locale) override; |
98 | 98 |
99 // Special method to set value for HTML5 month input type. | 99 // Special method to set value for HTML5 month input type. |
100 void SetInfoForMonthInputType(const base::string16& value); | 100 void SetInfoForMonthInputType(const base::string16& value); |
101 | 101 |
102 const std::string& network() const { return network_; } | 102 const std::string& network() const { return network_; } |
103 | 103 |
| 104 const std::string& bank_name() const { return bank_name_; } |
| 105 void set_bank_name(const std::string& bank_name) { bank_name_ = bank_name; } |
| 106 |
104 int expiration_month() const { return expiration_month_; } | 107 int expiration_month() const { return expiration_month_; } |
105 int expiration_year() const { return expiration_year_; } | 108 int expiration_year() const { return expiration_year_; } |
106 | 109 |
107 // These setters verify that the month and year are within appropriate | 110 // These setters verify that the month and year are within appropriate |
108 // ranges, or 0. They take integers as an alternative to setting the inputs | 111 // ranges, or 0. They take integers as an alternative to setting the inputs |
109 // from strings via SetInfo(). | 112 // from strings via SetInfo(). |
110 void SetExpirationMonth(int expiration_month); | 113 void SetExpirationMonth(int expiration_month); |
111 void SetExpirationYear(int expiration_year); | 114 void SetExpirationYear(int expiration_year); |
112 | 115 |
113 const std::string& server_id() const { return server_id_; } | 116 const std::string& server_id() const { return server_id_; } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 const std::pair<base::string16, base::string16> LabelPieces() const; | 205 const std::pair<base::string16, base::string16> LabelPieces() const; |
203 // Like LabelPieces, but appends the two pieces together. | 206 // Like LabelPieces, but appends the two pieces together. |
204 const base::string16 Label() const; | 207 const base::string16 Label() const; |
205 // The last four digits of the card number (or possibly less if there aren't | 208 // The last four digits of the card number (or possibly less if there aren't |
206 // enough characters). | 209 // enough characters). |
207 base::string16 LastFourDigits() const; | 210 base::string16 LastFourDigits() const; |
208 // The user-visible issuer network of the card, e.g. 'Mastercard'. | 211 // The user-visible issuer network of the card, e.g. 'Mastercard'. |
209 base::string16 NetworkForDisplay() const; | 212 base::string16 NetworkForDisplay() const; |
210 // A label for this card formatted as 'IssuerNetwork - 2345'. | 213 // A label for this card formatted as 'IssuerNetwork - 2345'. |
211 base::string16 NetworkAndLastFourDigits() const; | 214 base::string16 NetworkAndLastFourDigits() const; |
| 215 // A label for this card formatted as 'BankName - 2345'. |
| 216 base::string16 BankNameAndLastFourDigits() const; |
212 // Localized expiration for this card formatted as 'Exp: 06/17'. | 217 // Localized expiration for this card formatted as 'Exp: 06/17'. |
213 base::string16 AbbreviatedExpirationDateForDisplay() const; | 218 base::string16 AbbreviatedExpirationDateForDisplay() const; |
214 // Returns the date when the card was last used in autofill. | 219 // Returns the date when the card was last used in autofill. |
215 base::string16 GetLastUsedDateForDisplay(const std::string& app_locale) const; | 220 base::string16 GetLastUsedDateForDisplay(const std::string& app_locale) const; |
216 // Formatted expiration date (e.g., 05/2020). | 221 // Formatted expiration date (e.g., 05/2020). |
217 base::string16 ExpirationDateForDisplay() const; | 222 base::string16 ExpirationDateForDisplay() const; |
218 // Expiration functions. | 223 // Expiration functions. |
219 base::string16 ExpirationMonthAsString() const; | 224 base::string16 ExpirationMonthAsString() const; |
220 base::string16 Expiration4DigitYearAsString() const; | 225 base::string16 Expiration4DigitYearAsString() const; |
221 | 226 |
(...skipping 20 matching lines...) Expand all Loading... |
242 // last four digits of the card number. | 247 // last four digits of the card number. |
243 base::string16 number_; | 248 base::string16 number_; |
244 | 249 |
245 // The cardholder's name. May be empty. | 250 // The cardholder's name. May be empty. |
246 base::string16 name_on_card_; | 251 base::string16 name_on_card_; |
247 | 252 |
248 // The network issuer of the card. This is one of the k...Card constants | 253 // The network issuer of the card. This is one of the k...Card constants |
249 // below. | 254 // below. |
250 std::string network_; | 255 std::string network_; |
251 | 256 |
| 257 // The issuer bank name of the card. |
| 258 std::string bank_name_; |
| 259 |
252 // These members are zero if not present. | 260 // These members are zero if not present. |
253 int expiration_month_; | 261 int expiration_month_; |
254 int expiration_year_; | 262 int expiration_year_; |
255 | 263 |
256 // For server cards (both MASKED and UNMASKED) this is the ID assigned by the | 264 // For server cards (both MASKED and UNMASKED) this is the ID assigned by the |
257 // server to uniquely identify this card. | 265 // server to uniquely identify this card. |
258 std::string server_id_; | 266 std::string server_id_; |
259 | 267 |
260 // The status of the card, as reported by the server. Not valid for local | 268 // The status of the card, as reported by the server. Not valid for local |
261 // cards. | 269 // cards. |
(...skipping 14 matching lines...) Expand all Loading... |
276 extern const char kGenericCard[]; | 284 extern const char kGenericCard[]; |
277 extern const char kJCBCard[]; | 285 extern const char kJCBCard[]; |
278 extern const char kMasterCard[]; | 286 extern const char kMasterCard[]; |
279 extern const char kMirCard[]; | 287 extern const char kMirCard[]; |
280 extern const char kUnionPay[]; | 288 extern const char kUnionPay[]; |
281 extern const char kVisaCard[]; | 289 extern const char kVisaCard[]; |
282 | 290 |
283 } // namespace autofill | 291 } // namespace autofill |
284 | 292 |
285 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ | 293 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ |
OLD | NEW |