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

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

Issue 1814883002: [Autofill] Check for full state name and abbreviation when determining types to upload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit Created 4 years, 9 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
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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 ADDRESS_HOME_STREET_ADDRESS)), 629 ADDRESS_HOME_STREET_ADDRESS)),
630 CanonicalizeProfileString(GetRawInfo( 630 CanonicalizeProfileString(GetRawInfo(
631 ADDRESS_HOME_STREET_ADDRESS)))) { 631 ADDRESS_HOME_STREET_ADDRESS)))) {
632 return false; 632 return false;
633 } 633 }
634 continue; 634 continue;
635 } 635 }
636 // Special case for the state to support abbreviations. Currently only the 636 // Special case for the state to support abbreviations. Currently only the
637 // US states are supported. 637 // US states are supported.
638 if (field_type == ADDRESS_HOME_STATE) { 638 if (field_type == ADDRESS_HOME_STATE) {
639 base::string16 full, abbreviation; 639 base::string16 full;
640 base::string16 abbreviation;
640 state_names::GetNameAndAbbreviation(GetRawInfo(ADDRESS_HOME_STATE), 641 state_names::GetNameAndAbbreviation(GetRawInfo(ADDRESS_HOME_STATE),
641 &full, &abbreviation); 642 &full, &abbreviation);
642 if (compare.StringsEqual(profile.GetRawInfo(ADDRESS_HOME_STATE), 643 if (compare.StringsEqual(profile.GetRawInfo(ADDRESS_HOME_STATE),
643 full) || 644 full) ||
644 compare.StringsEqual(profile.GetRawInfo(ADDRESS_HOME_STATE), 645 compare.StringsEqual(profile.GetRawInfo(ADDRESS_HOME_STATE),
645 abbreviation)) 646 abbreviation))
646 continue; 647 continue;
647 } 648 }
648 if (!compare.StringsEqual(profile.GetRawInfo(field_type), 649 if (!compare.StringsEqual(profile.GetRawInfo(field_type),
649 GetRawInfo(field_type))) { 650 GetRawInfo(field_type))) {
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 << " " << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_CITY)) << " " 1048 << " " << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_CITY)) << " "
1048 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_STATE)) << " " 1049 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_STATE)) << " "
1049 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_ZIP)) << " " 1050 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_ZIP)) << " "
1050 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)) << " " 1051 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)) << " "
1051 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)) << " " 1052 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)) << " "
1052 << profile.language_code() << " " 1053 << profile.language_code() << " "
1053 << UTF16ToUTF8(profile.GetRawInfo(PHONE_HOME_WHOLE_NUMBER)); 1054 << UTF16ToUTF8(profile.GetRawInfo(PHONE_HOME_WHOLE_NUMBER));
1054 } 1055 }
1055 1056
1056 } // namespace autofill 1057 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698