| 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // Returns true if all field types have valid values set and the card is not | 167 // Returns true if all field types have valid values set and the card is not |
| 168 // expired. MASKED_SERVER_CARDs will never be valid because the number is | 168 // expired. MASKED_SERVER_CARDs will never be valid because the number is |
| 169 // not complete. | 169 // not complete. |
| 170 bool IsValid() const; | 170 bool IsValid() const; |
| 171 | 171 |
| 172 // Returns the credit card number. | 172 // Returns the credit card number. |
| 173 const base::string16& number() const { return number_; } | 173 const base::string16& number() const { return number_; } |
| 174 // Sets |number_| to |number| and computes the appropriate card |type_|. | 174 // Sets |number_| to |number| and computes the appropriate card |type_|. |
| 175 void SetNumber(const base::string16& number); | 175 void SetNumber(const base::string16& number); |
| 176 | 176 |
| 177 // Returns the date when the credit card was last used in autofill. |
| 178 base::string16 GetLastUsedDateForDisplay(const std::string& app_locale) const; |
| 179 |
| 177 // Logs the number of days since the credit card was last used and records its | 180 // Logs the number of days since the credit card was last used and records its |
| 178 // use. | 181 // use. |
| 179 void RecordAndLogUse(); | 182 void RecordAndLogUse(); |
| 180 | 183 |
| 181 // Converts a string representation of a month (such as "February" or "feb." | 184 // Converts a string representation of a month (such as "February" or "feb." |
| 182 // or "2") into a numeric value in [1, 12]. Returns true on successful | 185 // or "2") into a numeric value in [1, 12]. Returns true on successful |
| 183 // conversion or false if a month was not recognized. | 186 // conversion or false if a month was not recognized. |
| 184 static bool ConvertMonth(const base::string16& month, | 187 static bool ConvertMonth(const base::string16& month, |
| 185 const std::string& app_locale, | 188 const std::string& app_locale, |
| 186 int* num); | 189 int* num); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 extern const char kGenericCard[]; | 269 extern const char kGenericCard[]; |
| 267 extern const char kJCBCard[]; | 270 extern const char kJCBCard[]; |
| 268 extern const char kMasterCard[]; | 271 extern const char kMasterCard[]; |
| 269 extern const char kMirCard[]; | 272 extern const char kMirCard[]; |
| 270 extern const char kUnionPay[]; | 273 extern const char kUnionPay[]; |
| 271 extern const char kVisaCard[]; | 274 extern const char kVisaCard[]; |
| 272 | 275 |
| 273 } // namespace autofill | 276 } // namespace autofill |
| 274 | 277 |
| 275 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ | 278 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ |
| OLD | NEW |