| 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 #include "components/autofill/core/browser/autofill_profile.h" | 5 #include "components/autofill/core/browser/autofill_profile.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 | 276 |
| 277 return *this; | 277 return *this; |
| 278 } | 278 } |
| 279 | 279 |
| 280 // TODO(crbug.com/589535): Disambiguate similar field types before uploading. | 280 // TODO(crbug.com/589535): Disambiguate similar field types before uploading. |
| 281 void AutofillProfile::GetMatchingTypes( | 281 void AutofillProfile::GetMatchingTypes( |
| 282 const base::string16& text, | 282 const base::string16& text, |
| 283 const std::string& app_locale, | 283 const std::string& app_locale, |
| 284 ServerFieldTypeSet* matching_types) const { | 284 ServerFieldTypeSet* matching_types) const { |
| 285 FormGroupList info = FormGroups(); | 285 FormGroupList info = FormGroups(); |
| 286 for (const auto& it : info) { | 286 for (auto* it : info) { |
| 287 it->GetMatchingTypes(text, app_locale, matching_types); | 287 it->GetMatchingTypes(text, app_locale, matching_types); |
| 288 } | 288 } |
| 289 } | 289 } |
| 290 | 290 |
| 291 base::string16 AutofillProfile::GetRawInfo(ServerFieldType type) const { | 291 base::string16 AutofillProfile::GetRawInfo(ServerFieldType type) const { |
| 292 const FormGroup* form_group = FormGroupForType(AutofillType(type)); | 292 const FormGroup* form_group = FormGroupForType(AutofillType(type)); |
| 293 if (!form_group) | 293 if (!form_group) |
| 294 return base::string16(); | 294 return base::string16(); |
| 295 | 295 |
| 296 return form_group->GetRawInfo(type); | 296 return form_group->GetRawInfo(type); |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 base::string16 AutofillProfile::CanonicalizeProfileString( | 786 base::string16 AutofillProfile::CanonicalizeProfileString( |
| 787 const base::string16& str) { | 787 const base::string16& str) { |
| 788 // The locale doesn't matter for general string canonicalization. | 788 // The locale doesn't matter for general string canonicalization. |
| 789 AutofillProfileComparator comparator("en-US"); | 789 AutofillProfileComparator comparator("en-US"); |
| 790 return comparator.NormalizeForComparison(str); | 790 return comparator.NormalizeForComparison(str); |
| 791 } | 791 } |
| 792 | 792 |
| 793 void AutofillProfile::GetSupportedTypes( | 793 void AutofillProfile::GetSupportedTypes( |
| 794 ServerFieldTypeSet* supported_types) const { | 794 ServerFieldTypeSet* supported_types) const { |
| 795 FormGroupList info = FormGroups(); | 795 FormGroupList info = FormGroups(); |
| 796 for (const auto& it : info) { | 796 for (auto* it : info) { |
| 797 it->GetSupportedTypes(supported_types); | 797 it->GetSupportedTypes(supported_types); |
| 798 } | 798 } |
| 799 } | 799 } |
| 800 | 800 |
| 801 base::string16 AutofillProfile::ConstructInferredLabel( | 801 base::string16 AutofillProfile::ConstructInferredLabel( |
| 802 const std::vector<ServerFieldType>& included_fields, | 802 const std::vector<ServerFieldType>& included_fields, |
| 803 size_t num_fields_to_use, | 803 size_t num_fields_to_use, |
| 804 const std::string& app_locale) const { | 804 const std::string& app_locale) const { |
| 805 // TODO(estade): use libaddressinput? | 805 // TODO(estade): use libaddressinput? |
| 806 base::string16 separator = | 806 base::string16 separator = |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 << " " << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_CITY)) << " " | 1019 << " " << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_CITY)) << " " |
| 1020 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_STATE)) << " " | 1020 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_STATE)) << " " |
| 1021 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_ZIP)) << " " | 1021 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_ZIP)) << " " |
| 1022 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)) << " " | 1022 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)) << " " |
| 1023 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)) << " " | 1023 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)) << " " |
| 1024 << profile.language_code() << " " | 1024 << profile.language_code() << " " |
| 1025 << UTF16ToUTF8(profile.GetRawInfo(PHONE_HOME_WHOLE_NUMBER)); | 1025 << UTF16ToUTF8(profile.GetRawInfo(PHONE_HOME_WHOLE_NUMBER)); |
| 1026 } | 1026 } |
| 1027 | 1027 |
| 1028 } // namespace autofill | 1028 } // namespace autofill |
| OLD | NEW |