Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5614)

Unified Diff: components/autofill/core/browser/credit_card.h

Issue 381613005: [Autofill] Autofill fails to fill credit card number when split across fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698