Chromium Code Reviews| Index: components/autofill/core/browser/credit_card.h |
| diff --git a/components/autofill/core/browser/credit_card.h b/components/autofill/core/browser/credit_card.h |
| index 3c4c1f65c314442636df8ee31834ad0a763bd2bd..b4a5e76a5d94a5257ef122a4567ecea0ac6fef6c 100644 |
| --- a/components/autofill/core/browser/credit_card.h |
| +++ b/components/autofill/core/browser/credit_card.h |
| @@ -112,7 +112,7 @@ class CreditCard : public AutofillDataModel { |
| bool IsValid() const; |
| // Returns the credit card number. |
| - const base::string16& number() const { return number_; } |
| + base::string16 GetNumber() const; |
| private: |
| // FormGroup: |
| @@ -133,15 +133,21 @@ class CreditCard : public AutofillDataModel { |
| // Sets |expiration_year_| to the integer conversion of |text|. |
| void SetExpirationYearFromString(const base::string16& text); |
| + enum Part { first_part, second_part, third_part, last_part, full_number }; |
| + |
| // Sets |number_| to |number| and computes the appropriate card |type_|. |
| - void SetNumber(const base::string16& number); |
| + void SetNumber(const base::string16& number, |
| + const Part& part = autofill::CreditCard::full_number); |
| // These setters verify that the month and year are within appropriate |
| // ranges. |
| void SetExpirationMonth(int expiration_month); |
| void SetExpirationYear(int expiration_year); |
| - base::string16 number_; // The credit card number. |
| + base::string16 number_part1_; // The credit card number part 1 (0-3). |
| + base::string16 number_part2_; // The credit card number part 2 (4-7). |
| + base::string16 number_part3_; // The credit card number part 3 (8-12). |
| + base::string16 number_part4_; // The credit card number part 4 (12-End). |
|
Ilya Sherman
2014/07/25 03:37:49
These shouldn't be necessary. The card number sho
Pritam Nikam
2014/07/26 11:29:50
Done.
|
| base::string16 name_on_card_; // The cardholder's name. |
| std::string type_; // The type of the card. |