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

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

Issue 1818403003: Don't ever attempt to upload credit cards whose numbers match. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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_
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