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

Side by Side Diff: components/autofill/core/browser/credit_card.h

Issue 1540423004: Add card details and legal message to Android save credit card infobar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Justin's nits. Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 ~CreditCard() override; 56 ~CreditCard() override;
57 57
58 // Returns a version of |number| that has any separator characters removed. 58 // Returns a version of |number| that has any separator characters removed.
59 static const base::string16 StripSeparators(const base::string16& number); 59 static const base::string16 StripSeparators(const base::string16& number);
60 60
61 // The user-visible type of the card, e.g. 'Mastercard'. 61 // The user-visible type of the card, e.g. 'Mastercard'.
62 static base::string16 TypeForDisplay(const std::string& type); 62 static base::string16 TypeForDisplay(const std::string& type);
63 63
64 // This method is not compiled on iOS because the resources are not used and 64 // This method is not compiled on iOS because the resources are not used and
65 // should not be shipped. 65 // should not be shipped.
66 // TODO(rouslan): Use credit card issuer images on iOS. http://crbug.com/535784
66 #if !defined(OS_IOS) 67 #if !defined(OS_IOS)
67 // The ResourceBundle ID for the appropriate credit card image. 68 // The ResourceBundle ID for the appropriate credit card image.
68 static int IconResourceId(const std::string& type); 69 static int IconResourceId(const std::string& type);
69 #endif // #if !defined(OS_IOS) 70 #endif // #if !defined(OS_IOS)
70 71
71 // Returns the internal representation of credit card type corresponding to 72 // Returns the internal representation of credit card type corresponding to
72 // the given |number|. The credit card type is determined purely according to 73 // the given |number|. The credit card type is determined purely according to
73 // the Issuer Identification Number (IIN), a.k.a. the "Bank Identification 74 // the Issuer Identification Number (IIN), a.k.a. the "Bank Identification
74 // Number (BIN)", which is parsed from the relevant prefix of the |number|. 75 // Number (BIN)", which is parsed from the relevant prefix of the |number|.
75 // This function performs no additional validation checks on the |number|. 76 // This function performs no additional validation checks on the |number|.
(...skipping 25 matching lines...) Expand all
101 102
102 // Like LabelPieces, but appends the two pieces together. 103 // Like LabelPieces, but appends the two pieces together.
103 const base::string16 Label() const; 104 const base::string16 Label() const;
104 105
105 // Special method to set value for HTML5 month input type. 106 // Special method to set value for HTML5 month input type.
106 void SetInfoForMonthInputType(const base::string16& value); 107 void SetInfoForMonthInputType(const base::string16& value);
107 108
108 // The last four digits of the credit card number (or possibly less if there 109 // The last four digits of the credit card number (or possibly less if there
109 // aren't enough characters). 110 // aren't enough characters).
110 base::string16 LastFourDigits() const; 111 base::string16 LastFourDigits() const;
112 // The last four digits of the credit card formatted for display as '***2345'.
113 base::string16 LastFourDigitsForDisplay() const;
Evan Stade 2016/01/08 03:14:12 Can you leave these functions alone and just prepe
please use gerrit instead 2016/01/12 00:47:26 Done.
111 // The user-visible type of the card, e.g. 'Mastercard'. 114 // The user-visible type of the card, e.g. 'Mastercard'.
112 base::string16 TypeForDisplay() const; 115 base::string16 TypeForDisplay() const;
113 // A label for this credit card formatted as 'Cardname - 2345'. 116 // A label for this credit card formatted as 'IssuerName ***2345'.
Evan Stade 2016/01/08 03:14:12 asterisk is not correct
please use gerrit instead 2016/01/12 00:47:26 Done.
114 base::string16 TypeAndLastFourDigits() const; 117 base::string16 TypeAndLastFourDigitsForDisplay() const;
118
119 // The expiration for this credit card formatted as 'Exp: 06/17'.
120 base::string16 AbbreviatedExpirationDateForDisplay() const;
115 121
116 const std::string& type() const { return type_; } 122 const std::string& type() const { return type_; }
117 123
118 int expiration_month() const { return expiration_month_; } 124 int expiration_month() const { return expiration_month_; }
119 int expiration_year() const { return expiration_year_; } 125 int expiration_year() const { return expiration_year_; }
120 126
121 // These setters verify that the month and year are within appropriate 127 // These setters verify that the month and year are within appropriate
122 // ranges, or 0. They take integers as an alternative to setting the inputs 128 // ranges, or 0. They take integers as an alternative to setting the inputs
123 // from strings via SetInfo(). 129 // from strings via SetInfo().
124 void SetExpirationMonth(int expiration_month); 130 void SetExpirationMonth(int expiration_month);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 extern const char kDiscoverCard[]; 246 extern const char kDiscoverCard[];
241 extern const char kGenericCard[]; 247 extern const char kGenericCard[];
242 extern const char kJCBCard[]; 248 extern const char kJCBCard[];
243 extern const char kMasterCard[]; 249 extern const char kMasterCard[];
244 extern const char kUnionPay[]; 250 extern const char kUnionPay[];
245 extern const char kVisaCard[]; 251 extern const char kVisaCard[];
246 252
247 } // namespace autofill 253 } // namespace autofill
248 254
249 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ 255 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698