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

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

Issue 1989173005: [Autofill] Dedupe similar profiles on insertion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 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
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_profile.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_AUTOFILL_PROFILE_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_ 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <iosfwd> 10 #include <iosfwd>
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // Same as operator==, but ignores differences in guid and cares about 92 // Same as operator==, but ignores differences in guid and cares about
93 // differences in usage stats. 93 // differences in usage stats.
94 bool EqualsForSyncPurposes(const AutofillProfile& profile) const; 94 bool EqualsForSyncPurposes(const AutofillProfile& profile) const;
95 95
96 // Equality operators compare GUIDs, origins, language code, and the contents 96 // Equality operators compare GUIDs, origins, language code, and the contents
97 // in the comparison. Usage metadata (use count, use date, modification date) 97 // in the comparison. Usage metadata (use count, use date, modification date)
98 // are NOT compared. 98 // are NOT compared.
99 bool operator==(const AutofillProfile& profile) const; 99 bool operator==(const AutofillProfile& profile) const;
100 virtual bool operator!=(const AutofillProfile& profile) const; 100 virtual bool operator!=(const AutofillProfile& profile) const;
101 101
102 // Returns concatenation of first name, last name, address line 1 and city. 102 // Returns concatenation of first name, last name, address line 1 and city,
103 // This acts as the basis of comparison for new values that are submitted 103 // with each part separated by a whitespace. This acts as the basis of
104 // through forms to aid with correct aggregation of new data. 104 // comparison for new values that are submitted through forms to aid with
105 const base::string16 PrimaryValue() const; 105 // correct aggregation of new data.
106 const base::string16 PrimaryValue(const std::string& app_locale) const;
106 107
107 // Returns true if the data in this AutofillProfile is a subset of the data in 108 // Returns true if the data in this AutofillProfile is a subset of the data in
108 // |profile|. 109 // |profile|.
109 bool IsSubsetOf(const AutofillProfile& profile, 110 bool IsSubsetOf(const AutofillProfile& profile,
110 const std::string& app_locale) const; 111 const std::string& app_locale) const;
111 112
112 // Like IsSubsetOf, but only considers the types present in |types|. 113 // Like IsSubsetOf, but only considers the types present in |types|.
113 bool IsSubsetOfForFieldSet(const AutofillProfile& profile, 114 bool IsSubsetOfForFieldSet(const AutofillProfile& profile,
114 const std::string& app_locale, 115 const std::string& app_locale,
115 const ServerFieldTypeSet& types) const; 116 const ServerFieldTypeSet& types) const;
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 // a hash of the contents. 250 // a hash of the contents.
250 std::string server_id_; 251 std::string server_id_;
251 }; 252 };
252 253
253 // So we can compare AutofillProfiles with EXPECT_EQ(). 254 // So we can compare AutofillProfiles with EXPECT_EQ().
254 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile); 255 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile);
255 256
256 } // namespace autofill 257 } // namespace autofill
257 258
258 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_ 259 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_
OLDNEW
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698