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

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

Issue 2673753005: [Payments] Basic validation in the credit card editor. (Closed)
Patch Set: rouslan's comments Created 3 years, 10 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 d0a8a6eee7ee8b3b720d6e44035359baee0be127..47d06f1813afca09075e2320286834da70f425be 100644
--- a/components/autofill/core/browser/credit_card.h
+++ b/components/autofill/core/browser/credit_card.h
@@ -196,6 +196,20 @@ class CreditCard : public AutofillDataModel {
billing_address_id_ = id;
}
+ // Sets |expiration_month_| to the integer conversion of |text| and returns
+ // whether the operation was successful.
+ bool SetExpirationMonthFromString(const base::string16& text,
+ const std::string& app_locale);
+
+ // Sets |expiration_year_| to the integer conversion of |text|. Will handle
+ // 4-digit year or 2-digit year (eventually converted to 4-digit year).
+ void SetExpirationYearFromString(const base::string16& text);
+
+ // Sets |expiration_year_| and |expiration_month_| to the integer conversion
+ // of |text|. Will handle mmyy, mmyyyy, mm-yyyy and mm-yy as well as single
+ // digit months, with various separators.
+ void SetExpirationDateFromString(const base::string16& text);
+
private:
FRIEND_TEST_ALL_PREFIXES(CreditCardTest, SetExpirationDateFromString);
FRIEND_TEST_ALL_PREFIXES(CreditCardTest, SetExpirationYearFromString);
@@ -213,20 +227,6 @@ class CreditCard : public AutofillDataModel {
base::string16 Expiration4DigitYearAsString() const;
base::string16 Expiration2DigitYearAsString() const;
- // Sets |expiration_month_| to the integer conversion of |text| and returns
- // whether the operation was successful.
- bool SetExpirationMonthFromString(const base::string16& text,
- const std::string& app_locale);
-
- // Sets |expiration_year_| to the integer conversion of |text|. Will handle
- // 4-digit year or 2-digit year (eventually converted to 4-digit year).
- void SetExpirationYearFromString(const base::string16& text);
-
- // Sets |expiration_year_| and |expiration_month_| to the integer conversion
- // of |text|. Will handle mmyy, mmyyyy, mm-yyyy and mm-yy as well as single
- // digit months, with various separators.
- void SetExpirationDateFromString(const base::string16& text);
-
// See enum definition above.
RecordType record_type_;

Powered by Google App Engine
This is Rietveld 408576698