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

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

Issue 2041413004: Add an AutofillProfileComparator class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 // TODO(crbug.com/574081): Move common profile methods to a utils file. 179 // TODO(crbug.com/574081): Move common profile methods to a utils file.
180 // Returns a standardized representation of the given string for comparison 180 // Returns a standardized representation of the given string for comparison
181 // purposes. The resulting string will be lower-cased with all punctuation 181 // purposes. The resulting string will be lower-cased with all punctuation
182 // substituted by spaces. Whitespace will be converted to ASCII space, and 182 // substituted by spaces. Whitespace will be converted to ASCII space, and
183 // multiple whitespace characters will be collapsed. 183 // multiple whitespace characters will be collapsed.
184 // 184 //
185 // This string is designed for comparison purposes only and isn't suitable 185 // This string is designed for comparison purposes only and isn't suitable
186 // for storing or displaying to the user. 186 // for storing or displaying to the user.
187 static base::string16 CanonicalizeProfileString(const base::string16& str); 187 static base::string16 CanonicalizeProfileString(const base::string16& str);
188 188
189 // Returns true if the given two profile strings are similar enough that
190 // they probably refer to the same thing.
191 static bool AreProfileStringsSimilar(const base::string16& a,
192 const base::string16& b);
193
194 private: 189 private:
195 typedef std::vector<const FormGroup*> FormGroupList; 190 typedef std::vector<const FormGroup*> FormGroupList;
196 191
197 // FormGroup: 192 // FormGroup:
198 void GetSupportedTypes(ServerFieldTypeSet* supported_types) const override; 193 void GetSupportedTypes(ServerFieldTypeSet* supported_types) const override;
199 194
200 // Builds inferred label from the first |num_fields_to_include| non-empty 195 // Builds inferred label from the first |num_fields_to_include| non-empty
201 // fields in |label_fields|. Uses as many fields as possible if there are not 196 // fields in |label_fields|. Uses as many fields as possible if there are not
202 // enough non-empty fields. 197 // enough non-empty fields.
203 base::string16 ConstructInferredLabel( 198 base::string16 ConstructInferredLabel(
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 // a hash of the contents. 244 // a hash of the contents.
250 std::string server_id_; 245 std::string server_id_;
251 }; 246 };
252 247
253 // So we can compare AutofillProfiles with EXPECT_EQ(). 248 // So we can compare AutofillProfiles with EXPECT_EQ().
254 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile); 249 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile);
255 250
256 } // namespace autofill 251 } // namespace autofill
257 252
258 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_ 253 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_
OLDNEW
« no previous file with comments | « components/autofill/core/browser/BUILD.gn ('k') | components/autofill/core/browser/autofill_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698