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

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

Issue 332213004: Fix profile comparison re: address lines. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: change test Created 6 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 | Annotate | Revision Log
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 <ostream> 10 #include <ostream>
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 411
412 default: 412 default:
413 NOTREACHED(); 413 NOTREACHED();
414 return false; 414 return false;
415 } 415 }
416 } 416 }
417 417
418 int AutofillProfile::Compare(const AutofillProfile& profile) const { 418 int AutofillProfile::Compare(const AutofillProfile& profile) const {
419 const ServerFieldType single_value_types[] = { 419 const ServerFieldType single_value_types[] = {
420 COMPANY_NAME, 420 COMPANY_NAME,
421 ADDRESS_HOME_LINE1, 421 ADDRESS_HOME_STREET_ADDRESS,
422 ADDRESS_HOME_LINE2,
423 ADDRESS_HOME_DEPENDENT_LOCALITY, 422 ADDRESS_HOME_DEPENDENT_LOCALITY,
424 ADDRESS_HOME_CITY, 423 ADDRESS_HOME_CITY,
425 ADDRESS_HOME_STATE, 424 ADDRESS_HOME_STATE,
426 ADDRESS_HOME_ZIP, 425 ADDRESS_HOME_ZIP,
427 ADDRESS_HOME_SORTING_CODE, 426 ADDRESS_HOME_SORTING_CODE,
428 ADDRESS_HOME_COUNTRY, 427 ADDRESS_HOME_COUNTRY,
429 }; 428 };
430 429
431 for (size_t i = 0; i < arraysize(single_value_types); ++i) { 430 for (size_t i = 0; i < arraysize(single_value_types); ++i) {
432 int comparison = GetRawInfo(single_value_types[i]).compare( 431 int comparison = GetRawInfo(single_value_types[i]).compare(
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)) 866 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE))
868 << " " 867 << " "
869 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)) 868 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY))
870 << " " 869 << " "
871 << profile.language_code() 870 << profile.language_code()
872 << " " 871 << " "
873 << UTF16ToUTF8(MultiString(profile, PHONE_HOME_WHOLE_NUMBER)); 872 << UTF16ToUTF8(MultiString(profile, PHONE_HOME_WHOLE_NUMBER));
874 } 873 }
875 874
876 } // namespace autofill 875 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698