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

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

Issue 1080883002: Remove some more bad ASCII-centric autofill code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tests Created 5 years, 8 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // Returns true if all field types have valid values set and the card is not 165 // Returns true if all field types have valid values set and the card is not
166 // expired. MASKED_SERVER_CARDs will never be valid because the number is 166 // expired. MASKED_SERVER_CARDs will never be valid because the number is
167 // not complete. 167 // not complete.
168 bool IsValid() const; 168 bool IsValid() const;
169 169
170 // Returns the credit card number. 170 // Returns the credit card number.
171 const base::string16& number() const { return number_; } 171 const base::string16& number() const { return number_; }
172 // Sets |number_| to |number| and computes the appropriate card |type_|. 172 // Sets |number_| to |number| and computes the appropriate card |type_|.
173 void SetNumber(const base::string16& number); 173 void SetNumber(const base::string16& number);
174 174
175 static bool ConvertMonth(const base::string16& month,
Lei Zhang 2015/04/11 02:44:17 The behavior is a bit quirky. Document? Esp. handl
Evan Stade 2015/04/13 18:13:43 Done.
176 const std::string& app_locale,
177 int* num);
178
175 private: 179 private:
176 // FormGroup: 180 // FormGroup:
177 void GetSupportedTypes(ServerFieldTypeSet* supported_types) const override; 181 void GetSupportedTypes(ServerFieldTypeSet* supported_types) const override;
178 182
179 // The type of the card to fill in to the page, e.g. 'Mastercard'. 183 // The type of the card to fill in to the page, e.g. 'Mastercard'.
180 base::string16 TypeForFill() const; 184 base::string16 TypeForFill() const;
181 185
182 // The month and year are zero if not present. 186 // The month and year are zero if not present.
183 int Expiration4DigitYear() const { return expiration_year_; } 187 int Expiration4DigitYear() const { return expiration_year_; }
184 int Expiration2DigitYear() const { return expiration_year_ % 100; } 188 int Expiration2DigitYear() const { return expiration_year_ % 100; }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 extern const char* const kDiscoverCard; 232 extern const char* const kDiscoverCard;
229 extern const char* const kGenericCard; 233 extern const char* const kGenericCard;
230 extern const char* const kJCBCard; 234 extern const char* const kJCBCard;
231 extern const char* const kMasterCard; 235 extern const char* const kMasterCard;
232 extern const char* const kUnionPay; 236 extern const char* const kUnionPay;
233 extern const char* const kVisaCard; 237 extern const char* const kVisaCard;
234 238
235 } // namespace autofill 239 } // namespace autofill
236 240
237 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ 241 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698