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

Unified Diff: components/autofill/core/browser/autofill_profile.cc

Issue 2093363002: Autofill address editor in PaymentRequest UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@contact-editor
Patch Set: Fix try-bot Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/autofill/core/browser/autofill_profile.h ('k') | third_party/libaddressinput/README.chromium » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/autofill_profile.cc
diff --git a/components/autofill/core/browser/autofill_profile.cc b/components/autofill/core/browser/autofill_profile.cc
index ee5111b1d0ca28fcf736ae562e6f753217683a92..22ae63992cdd304b73832fd90f66b3b2483a04e7 100644
--- a/components/autofill/core/browser/autofill_profile.cc
+++ b/components/autofill/core/browser/autofill_profile.cc
@@ -756,48 +756,6 @@ void AutofillProfile::CreateInferredLabels(
}
}
-void AutofillProfile::GenerateServerProfileIdentifier() {
- DCHECK_EQ(SERVER_PROFILE, record_type());
- base::string16 contents = GetRawInfo(NAME_FIRST);
- contents.append(GetRawInfo(NAME_MIDDLE));
- contents.append(GetRawInfo(NAME_LAST));
- contents.append(GetRawInfo(EMAIL_ADDRESS));
- contents.append(GetRawInfo(COMPANY_NAME));
- contents.append(GetRawInfo(ADDRESS_HOME_STREET_ADDRESS));
- contents.append(GetRawInfo(ADDRESS_HOME_DEPENDENT_LOCALITY));
- contents.append(GetRawInfo(ADDRESS_HOME_CITY));
- contents.append(GetRawInfo(ADDRESS_HOME_STATE));
- contents.append(GetRawInfo(ADDRESS_HOME_ZIP));
- contents.append(GetRawInfo(ADDRESS_HOME_SORTING_CODE));
- contents.append(GetRawInfo(ADDRESS_HOME_COUNTRY));
- contents.append(GetRawInfo(PHONE_HOME_WHOLE_NUMBER));
- std::string contents_utf8 = UTF16ToUTF8(contents);
- contents_utf8.append(language_code());
- server_id_ = base::SHA1HashString(contents_utf8);
-}
-
-void AutofillProfile::RecordAndLogUse() {
- UMA_HISTOGRAM_COUNTS_1000("Autofill.DaysSinceLastUse.Profile",
- (base::Time::Now() - use_date()).InDays());
- RecordUse();
-}
-
-// static
-base::string16 AutofillProfile::CanonicalizeProfileString(
- const base::string16& str) {
- // The locale doesn't matter for general string canonicalization.
- AutofillProfileComparator comparator("en-US");
- return comparator.NormalizeForComparison(str);
-}
-
-void AutofillProfile::GetSupportedTypes(
- ServerFieldTypeSet* supported_types) const {
- FormGroupList info = FormGroups();
- for (const auto& it : info) {
- it->GetSupportedTypes(supported_types);
- }
-}
-
base::string16 AutofillProfile::ConstructInferredLabel(
const std::vector<ServerFieldType>& included_fields,
size_t num_fields_to_use,
@@ -876,6 +834,48 @@ base::string16 AutofillProfile::ConstructInferredLabel(
return label;
}
+void AutofillProfile::GenerateServerProfileIdentifier() {
+ DCHECK_EQ(SERVER_PROFILE, record_type());
+ base::string16 contents = GetRawInfo(NAME_FIRST);
+ contents.append(GetRawInfo(NAME_MIDDLE));
+ contents.append(GetRawInfo(NAME_LAST));
+ contents.append(GetRawInfo(EMAIL_ADDRESS));
+ contents.append(GetRawInfo(COMPANY_NAME));
+ contents.append(GetRawInfo(ADDRESS_HOME_STREET_ADDRESS));
+ contents.append(GetRawInfo(ADDRESS_HOME_DEPENDENT_LOCALITY));
+ contents.append(GetRawInfo(ADDRESS_HOME_CITY));
+ contents.append(GetRawInfo(ADDRESS_HOME_STATE));
+ contents.append(GetRawInfo(ADDRESS_HOME_ZIP));
+ contents.append(GetRawInfo(ADDRESS_HOME_SORTING_CODE));
+ contents.append(GetRawInfo(ADDRESS_HOME_COUNTRY));
+ contents.append(GetRawInfo(PHONE_HOME_WHOLE_NUMBER));
+ std::string contents_utf8 = UTF16ToUTF8(contents);
+ contents_utf8.append(language_code());
+ server_id_ = base::SHA1HashString(contents_utf8);
+}
+
+void AutofillProfile::RecordAndLogUse() {
+ UMA_HISTOGRAM_COUNTS_1000("Autofill.DaysSinceLastUse.Profile",
+ (base::Time::Now() - use_date()).InDays());
+ RecordUse();
+}
+
+// static
+base::string16 AutofillProfile::CanonicalizeProfileString(
+ const base::string16& str) {
+ // The locale doesn't matter for general string canonicalization.
+ AutofillProfileComparator comparator("en-US");
+ return comparator.NormalizeForComparison(str);
+}
+
+void AutofillProfile::GetSupportedTypes(
+ ServerFieldTypeSet* supported_types) const {
+ FormGroupList info = FormGroups();
+ for (const auto& it : info) {
+ it->GetSupportedTypes(supported_types);
+ }
+}
+
// static
void AutofillProfile::CreateInferredLabelsHelper(
const std::vector<AutofillProfile*>& profiles,
« no previous file with comments | « components/autofill/core/browser/autofill_profile.h ('k') | third_party/libaddressinput/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698