| OLD | NEW |
| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // or < 0, or > 0 if it is different. The implied ordering can be used for | 145 // or < 0, or > 0 if it is different. The implied ordering can be used for |
| 146 // culling duplicates. The ordering is based on collation order of the | 146 // culling duplicates. The ordering is based on collation order of the |
| 147 // textual contents of the fields. | 147 // textual contents of the fields. |
| 148 // GUIDs, origins, labels, and unique IDs are not compared, only the values of | 148 // GUIDs, origins, labels, and unique IDs are not compared, only the values of |
| 149 // the credit cards themselves. | 149 // the credit cards themselves. |
| 150 int Compare(const CreditCard& credit_card) const; | 150 int Compare(const CreditCard& credit_card) const; |
| 151 | 151 |
| 152 // Determines if |this| is a local version of the server card |other|. | 152 // Determines if |this| is a local version of the server card |other|. |
| 153 bool IsLocalDuplicateOfServerCard(const CreditCard& other) const; | 153 bool IsLocalDuplicateOfServerCard(const CreditCard& other) const; |
| 154 | 154 |
| 155 // Determines if |this| has the same number as |other|. If either is a masked |
| 156 // server card, compares the last four digits only. |
| 157 bool HasSameNumberAs(const CreditCard& other) const; |
| 158 |
| 155 // Equality operators compare GUIDs, origins, and the contents. | 159 // Equality operators compare GUIDs, origins, and the contents. |
| 156 // Usage metadata (use count, use date, modification date) are NOT compared. | 160 // Usage metadata (use count, use date, modification date) are NOT compared. |
| 157 bool operator==(const CreditCard& credit_card) const; | 161 bool operator==(const CreditCard& credit_card) const; |
| 158 bool operator!=(const CreditCard& credit_card) const; | 162 bool operator!=(const CreditCard& credit_card) const; |
| 159 | 163 |
| 160 // How this card is stored. | 164 // How this card is stored. |
| 161 RecordType record_type() const { return record_type_; } | 165 RecordType record_type() const { return record_type_; } |
| 162 void set_record_type(RecordType rt) { record_type_ = rt; } | 166 void set_record_type(RecordType rt) { record_type_ = rt; } |
| 163 | 167 |
| 164 // Returns true if there are no values (field types) set. | 168 // Returns true if there are no values (field types) set. |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 extern const char kDiscoverCard[]; | 250 extern const char kDiscoverCard[]; |
| 247 extern const char kGenericCard[]; | 251 extern const char kGenericCard[]; |
| 248 extern const char kJCBCard[]; | 252 extern const char kJCBCard[]; |
| 249 extern const char kMasterCard[]; | 253 extern const char kMasterCard[]; |
| 250 extern const char kUnionPay[]; | 254 extern const char kUnionPay[]; |
| 251 extern const char kVisaCard[]; | 255 extern const char kVisaCard[]; |
| 252 | 256 |
| 253 } // namespace autofill | 257 } // namespace autofill |
| 254 | 258 |
| 255 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ | 259 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ |
| OLD | NEW |