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