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

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

Issue 2478463002: Reland of place for loops with |arraysize| with for each loops (Closed)
Patch Set: Created 4 years, 1 month 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 #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
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 (size_t i = 0; i < arraysize(types); ++i) { 357 for (ServerFieldType type : types) {
358 int comparison = GetRawInfo(types[i]).compare(profile.GetRawInfo(types[i])); 358 int comparison = GetRawInfo(type).compare(profile.GetRawInfo(type));
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
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
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_merge_unittest.cc ('k') | components/autofill/core/browser/contact_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698