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_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 Loading... |
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 Loading... |
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_ |
OLD | NEW |