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

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

Issue 17099006: Validate saved credit card number in interactive autocomplete (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge master Created 7 years, 6 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 <vector> 10 #include <vector>
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 // Used by tests. 100 // Used by tests.
101 bool operator==(const CreditCard& credit_card) const; 101 bool operator==(const CreditCard& credit_card) const;
102 bool operator!=(const CreditCard& credit_card) const; 102 bool operator!=(const CreditCard& credit_card) const;
103 103
104 // Returns true if there are no values (field types) set. 104 // Returns true if there are no values (field types) set.
105 bool IsEmpty(const std::string& app_locale) const; 105 bool IsEmpty(const std::string& app_locale) const;
106 106
107 // Returns true if all field types have valid values set. 107 // Returns true if all field types have valid values set.
108 bool IsComplete() const; 108 bool IsComplete() const;
109 109
110 // Returns true if all field types have valid values set and the card is not
111 // expired.
112 bool IsValid() const;
113
110 // Returns the credit card number. 114 // Returns the credit card number.
111 const base::string16& number() const { return number_; } 115 const base::string16& number() const { return number_; }
112 116
113 private: 117 private:
114 // FormGroup: 118 // FormGroup:
115 virtual void GetSupportedTypes(FieldTypeSet* supported_types) const OVERRIDE; 119 virtual void GetSupportedTypes(FieldTypeSet* supported_types) const OVERRIDE;
116 120
117 // The month and year are zero if not present. 121 // The month and year are zero if not present.
118 int Expiration4DigitYear() const { return expiration_year_; } 122 int Expiration4DigitYear() const { return expiration_year_; }
119 int Expiration2DigitYear() const { return expiration_year_ % 100; } 123 int Expiration2DigitYear() const { return expiration_year_ % 100; }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 extern const char* const kDiscoverCard; 158 extern const char* const kDiscoverCard;
155 extern const char* const kGenericCard; 159 extern const char* const kGenericCard;
156 extern const char* const kJCBCard; 160 extern const char* const kJCBCard;
157 extern const char* const kMasterCard; 161 extern const char* const kMasterCard;
158 extern const char* const kSoloCard; 162 extern const char* const kSoloCard;
159 extern const char* const kVisaCard; 163 extern const char* const kVisaCard;
160 164
161 } // namespace autofill 165 } // namespace autofill
162 166
163 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ 167 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/data_model_wrapper_unittest.cc ('k') | components/autofill/core/browser/credit_card.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698