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

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

Issue 2607043002: [Autofill] Credit Card Autofill Last Used Date Experiment (Closed)
Patch Set: Added unittest dependency Created 3 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 // Returns true if all field types have valid values set and the card is not 167 // Returns true if all field types have valid values set and the card is not
168 // expired. MASKED_SERVER_CARDs will never be valid because the number is 168 // expired. MASKED_SERVER_CARDs will never be valid because the number is
169 // not complete. 169 // not complete.
170 bool IsValid() const; 170 bool IsValid() const;
171 171
172 // Returns the credit card number. 172 // Returns the credit card number.
173 const base::string16& number() const { return number_; } 173 const base::string16& number() const { return number_; }
174 // Sets |number_| to |number| and computes the appropriate card |type_|. 174 // Sets |number_| to |number| and computes the appropriate card |type_|.
175 void SetNumber(const base::string16& number); 175 void SetNumber(const base::string16& number);
176 176
177 // Logs the number of days since the credit card was last used and records its 177 // Logs the number of days since the credit card was last used and records
178 // use. 178 // its use.
179 void RecordAndLogUse(); 179 void RecordAndLogUse();
180 180
181 // Converts a string representation of a month (such as "February" or "feb." 181 // Converts a string representation of a month (such as "February" or "feb."
182 // or "2") into a numeric value in [1, 12]. Returns true on successful 182 // or "2") into a numeric value in [1, 12]. Returns true on successful
183 // conversion or false if a month was not recognized. 183 // conversion or false if a month was not recognized.
184 static bool ConvertMonth(const base::string16& month, 184 static bool ConvertMonth(const base::string16& month,
185 const std::string& app_locale, 185 const std::string& app_locale,
186 int* num); 186 int* num);
187 187
188 // Returns whether the credit card is expired based on |current_time|. 188 // Returns whether the credit card is expired based on |current_time|.
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 extern const char kGenericCard[]; 266 extern const char kGenericCard[];
267 extern const char kJCBCard[]; 267 extern const char kJCBCard[];
268 extern const char kMasterCard[]; 268 extern const char kMasterCard[];
269 extern const char kMirCard[]; 269 extern const char kMirCard[];
270 extern const char kUnionPay[]; 270 extern const char kUnionPay[];
271 extern const char kVisaCard[]; 271 extern const char kVisaCard[];
272 272
273 } // namespace autofill 273 } // namespace autofill
274 274
275 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ 275 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698