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

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

Issue 1891903002: [Autofill] Set basic information when adding a new profiles and credit cards. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed test that was added in rebase and removed unnecessary test. Created 4 years, 8 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 <memory> 10 #include <memory>
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 425
426 bool AutofillProfile::operator==(const AutofillProfile& profile) const { 426 bool AutofillProfile::operator==(const AutofillProfile& profile) const {
427 return guid() == profile.guid() && EqualsSansGuid(profile); 427 return guid() == profile.guid() && EqualsSansGuid(profile);
428 } 428 }
429 429
430 bool AutofillProfile::operator!=(const AutofillProfile& profile) const { 430 bool AutofillProfile::operator!=(const AutofillProfile& profile) const {
431 return !operator==(profile); 431 return !operator==(profile);
432 } 432 }
433 433
434 const base::string16 AutofillProfile::PrimaryValue() const { 434 const base::string16 AutofillProfile::PrimaryValue() const {
435 return GetRawInfo(ADDRESS_HOME_LINE1) + GetRawInfo(ADDRESS_HOME_CITY); 435 return GetRawInfo(NAME_FIRST) + GetRawInfo(NAME_LAST) +
436 GetRawInfo(ADDRESS_HOME_LINE1) + GetRawInfo(ADDRESS_HOME_CITY);
436 } 437 }
437 438
438 bool AutofillProfile::IsSubsetOf(const AutofillProfile& profile, 439 bool AutofillProfile::IsSubsetOf(const AutofillProfile& profile,
439 const std::string& app_locale) const { 440 const std::string& app_locale) const {
440 ServerFieldTypeSet types; 441 ServerFieldTypeSet types;
441 GetSupportedTypes(&types); 442 GetSupportedTypes(&types);
442 return IsSubsetOfForFieldSet(profile, app_locale, types); 443 return IsSubsetOfForFieldSet(profile, app_locale, types);
443 } 444 }
444 445
445 bool AutofillProfile::IsSubsetOfForFieldSet( 446 bool AutofillProfile::IsSubsetOfForFieldSet(
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 << " " << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_CITY)) << " " 1050 << " " << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_CITY)) << " "
1050 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_STATE)) << " " 1051 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_STATE)) << " "
1051 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_ZIP)) << " " 1052 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_ZIP)) << " "
1052 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)) << " " 1053 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)) << " "
1053 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)) << " " 1054 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)) << " "
1054 << profile.language_code() << " " 1055 << profile.language_code() << " "
1055 << UTF16ToUTF8(profile.GetRawInfo(PHONE_HOME_WHOLE_NUMBER)); 1056 << UTF16ToUTF8(profile.GetRawInfo(PHONE_HOME_WHOLE_NUMBER));
1056 } 1057 }
1057 1058
1058 } // namespace autofill 1059 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698