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); | |
Ilya Sherman
2011/01/07 07:28:28
nit: "SetInfoForMonthInputType" might be a slightl
honten.org
2011/01/07 08:06:17
Yes, I wanted to declare it right after SetInfo(),
Ilya Sherman
2011/01/07 08:15:49
I would declare it right below that block of virtu
| |
78 | |
honten.org
2011/01/06 07:04:54
Implemented special method to parse month input ty
| |
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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 string16 label_; | 149 string16 label_; |
147 | 150 |
148 // The guid of this credit card. | 151 // The guid of this credit card. |
149 std::string guid_; | 152 std::string guid_; |
150 }; | 153 }; |
151 | 154 |
152 // So we can compare CreditCards with EXPECT_EQ(). | 155 // So we can compare CreditCards with EXPECT_EQ(). |
153 std::ostream& operator<<(std::ostream& os, const CreditCard& credit_card); | 156 std::ostream& operator<<(std::ostream& os, const CreditCard& credit_card); |
154 | 157 |
155 #endif // CHROME_BROWSER_AUTOFILL_CREDIT_CARD_H_ | 158 #endif // CHROME_BROWSER_AUTOFILL_CREDIT_CARD_H_ |
OLD | NEW |