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

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

Issue 2671813005: [Autofill] Use user's email for converted wallet addresses. (Closed)
Patch Set: Addressed comment Created 3 years, 10 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 | « no previous file | components/autofill/core/browser/personal_data_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/personal_data_manager.cc
diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc
index 740ee19f2ca73bc03b6dc6d30af851ea53102d20..6fe3cb4ab250ae60f9e19a7ac0cd1b13de5ea6f6 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -1918,6 +1918,15 @@ std::string PersonalDataManager::MergeServerAddressesIntoProfiles(
// Set the profile as being local.
existing_profiles->back().set_record_type(AutofillProfile::LOCAL_PROFILE);
existing_profiles->back().set_modification_date(AutofillClock::Now());
+
+ // Wallet addresses don't have an email address, use the one from the
+ // currently signed-in account.
+ std::string account_id = signin_manager_->GetAuthenticatedAccountId();
+ base::string16 email =
+ base::UTF8ToUTF16(account_tracker_->GetAccountInfo(account_id).email);
+ if (!email.empty())
+ existing_profiles->back().SetRawInfo(EMAIL_ADDRESS, email);
+
AutofillMetrics::LogWalletAddressConversionType(
AutofillMetrics::CONVERTED_ADDRESS_ADDED);
}
« no previous file with comments | « no previous file | components/autofill/core/browser/personal_data_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698