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

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

Issue 1808613004: Don't ever attempt to upload credit cards whose numbers match. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | components/autofill/core/browser/credit_card.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // or < 0, or > 0 if it is different. The implied ordering can be used for 148 // or < 0, or > 0 if it is different. The implied ordering can be used for
149 // culling duplicates. The ordering is based on collation order of the 149 // culling duplicates. The ordering is based on collation order of the
150 // textual contents of the fields. 150 // textual contents of the fields.
151 // GUIDs, origins, labels, and unique IDs are not compared, only the values of 151 // GUIDs, origins, labels, and unique IDs are not compared, only the values of
152 // the credit cards themselves. 152 // the credit cards themselves.
153 int Compare(const CreditCard& credit_card) const; 153 int Compare(const CreditCard& credit_card) const;
154 154
155 // Determines if |this| is a local version of the server card |other|. 155 // Determines if |this| is a local version of the server card |other|.
156 bool IsLocalDuplicateOfServerCard(const CreditCard& other) const; 156 bool IsLocalDuplicateOfServerCard(const CreditCard& other) const;
157 157
158 // Determines if |this| has the same number as |other|. If either is a masked
159 // server card, compares the last four digits only.
160 bool HasSameNumberAs(const CreditCard& other) const;
161
158 // Equality operators compare GUIDs, origins, and the contents. 162 // Equality operators compare GUIDs, origins, and the contents.
159 // Usage metadata (use count, use date, modification date) are NOT compared. 163 // Usage metadata (use count, use date, modification date) are NOT compared.
160 bool operator==(const CreditCard& credit_card) const; 164 bool operator==(const CreditCard& credit_card) const;
161 bool operator!=(const CreditCard& credit_card) const; 165 bool operator!=(const CreditCard& credit_card) const;
162 166
163 // How this card is stored. 167 // How this card is stored.
164 RecordType record_type() const { return record_type_; } 168 RecordType record_type() const { return record_type_; }
165 void set_record_type(RecordType rt) { record_type_ = rt; } 169 void set_record_type(RecordType rt) { record_type_ = rt; }
166 170
167 // Returns true if there are no values (field types) set. 171 // Returns true if there are no values (field types) set.
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 extern const char kDiscoverCard[]; 253 extern const char kDiscoverCard[];
250 extern const char kGenericCard[]; 254 extern const char kGenericCard[];
251 extern const char kJCBCard[]; 255 extern const char kJCBCard[];
252 extern const char kMasterCard[]; 256 extern const char kMasterCard[];
253 extern const char kUnionPay[]; 257 extern const char kUnionPay[];
254 extern const char kVisaCard[]; 258 extern const char kVisaCard[];
255 259
256 } // namespace autofill 260 } // namespace autofill
257 261
258 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_ 262 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_CREDIT_CARD_H_
OLDNEW
« no previous file with comments | « no previous file | components/autofill/core/browser/credit_card.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698