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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 ADDRESS_HOME_DEPENDENT_LOCALITY, | 347 ADDRESS_HOME_DEPENDENT_LOCALITY, |
348 ADDRESS_HOME_CITY, | 348 ADDRESS_HOME_CITY, |
349 ADDRESS_HOME_STATE, | 349 ADDRESS_HOME_STATE, |
350 ADDRESS_HOME_ZIP, | 350 ADDRESS_HOME_ZIP, |
351 ADDRESS_HOME_SORTING_CODE, | 351 ADDRESS_HOME_SORTING_CODE, |
352 ADDRESS_HOME_COUNTRY, | 352 ADDRESS_HOME_COUNTRY, |
353 EMAIL_ADDRESS, | 353 EMAIL_ADDRESS, |
354 PHONE_HOME_WHOLE_NUMBER, | 354 PHONE_HOME_WHOLE_NUMBER, |
355 }; | 355 }; |
356 | 356 |
357 for (ServerFieldType type : types) { | 357 for (size_t i = 0; i < arraysize(types); ++i) { |
358 int comparison = GetRawInfo(type).compare(profile.GetRawInfo(type)); | 358 int comparison = GetRawInfo(types[i]).compare(profile.GetRawInfo(types[i])); |
359 if (comparison != 0) { | 359 if (comparison != 0) { |
360 return comparison; | 360 return comparison; |
361 } | 361 } |
362 } | 362 } |
363 | 363 |
364 return 0; | 364 return 0; |
365 } | 365 } |
366 | 366 |
367 bool AutofillProfile::EqualsSansOrigin(const AutofillProfile& profile) const { | 367 bool AutofillProfile::EqualsSansOrigin(const AutofillProfile& profile) const { |
368 return guid() == profile.guid() && | 368 return guid() == profile.guid() && |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 << " " << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_CITY)) << " " | 855 << " " << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_CITY)) << " " |
856 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_STATE)) << " " | 856 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_STATE)) << " " |
857 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_ZIP)) << " " | 857 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_ZIP)) << " " |
858 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)) << " " | 858 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)) << " " |
859 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)) << " " | 859 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)) << " " |
860 << profile.language_code() << " " | 860 << profile.language_code() << " " |
861 << UTF16ToUTF8(profile.GetRawInfo(PHONE_HOME_WHOLE_NUMBER)); | 861 << UTF16ToUTF8(profile.GetRawInfo(PHONE_HOME_WHOLE_NUMBER)); |
862 } | 862 } |
863 | 863 |
864 } // namespace autofill | 864 } // namespace autofill |
OLD | NEW |