OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_AUTOFILL_CREDIT_CARD_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_CREDIT_CARD_H_ |
6 #define CHROME_BROWSER_AUTOFILL_CREDIT_CARD_H_ | 6 #define CHROME_BROWSER_AUTOFILL_CREDIT_CARD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // Returns true if |value| is a credit card number. Uses the Luhn formula to | 66 // Returns true if |value| is a credit card number. Uses the Luhn formula to |
67 // validate the number. | 67 // validate the number. |
68 static bool IsCreditCardNumber(const string16& text); | 68 static bool IsCreditCardNumber(const string16& text); |
69 | 69 |
70 // Returns true if there are no values (field types) set. | 70 // Returns true if there are no values (field types) set. |
71 bool IsEmpty() const; | 71 bool IsEmpty() const; |
72 | 72 |
73 // Returns the credit card number. | 73 // Returns the credit card number. |
74 const string16& number() const { return number_; } | 74 const string16& number() const { return number_; } |
75 | 75 |
| 76 // Special method to set value for HTML5 month input type. |
| 77 void SetMonthInputInfo(const string16& value); |
| 78 |
76 private: | 79 private: |
77 // The month and year are zero if not present. | 80 // The month and year are zero if not present. |
78 int Expiration4DigitYear() const { return expiration_year_; } | 81 int Expiration4DigitYear() const { return expiration_year_; } |
79 int Expiration2DigitYear() const { return expiration_year_ % 100; } | 82 int Expiration2DigitYear() const { return expiration_year_ % 100; } |
80 string16 ExpirationMonthAsString() const; | 83 string16 ExpirationMonthAsString() const; |
81 string16 Expiration4DigitYearAsString() const; | 84 string16 Expiration4DigitYearAsString() const; |
82 string16 Expiration2DigitYearAsString() const; | 85 string16 Expiration2DigitYearAsString() const; |
83 | 86 |
84 // Sets |expiration_month_| to the integer conversion of |text|. | 87 // Sets |expiration_month_| to the integer conversion of |text|. |
85 void SetExpirationMonthFromString(const string16& text); | 88 void SetExpirationMonthFromString(const string16& text); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 extern const char* const kAmericanExpressCard; | 159 extern const char* const kAmericanExpressCard; |
157 extern const char* const kDinersCard; | 160 extern const char* const kDinersCard; |
158 extern const char* const kDiscoverCard; | 161 extern const char* const kDiscoverCard; |
159 extern const char* const kGenericCard; | 162 extern const char* const kGenericCard; |
160 extern const char* const kJCBCard; | 163 extern const char* const kJCBCard; |
161 extern const char* const kMasterCard; | 164 extern const char* const kMasterCard; |
162 extern const char* const kSoloCard; | 165 extern const char* const kSoloCard; |
163 extern const char* const kVisaCard; | 166 extern const char* const kVisaCard; |
164 | 167 |
165 #endif // CHROME_BROWSER_AUTOFILL_CREDIT_CARD_H_ | 168 #endif // CHROME_BROWSER_AUTOFILL_CREDIT_CARD_H_ |
OLD | NEW |