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

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

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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 5d234adfaac692e3be272d361ac51b9cef83bd2f..296a0e1cb78a25b3c9c8a3176fc637322579b06a 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -32,6 +32,7 @@
#include "components/autofill/core/common/autofill_switches.h"
#include "components/signin/core/browser/account_tracker_service.h"
#include "components/signin/core/common/signin_pref_names.h"
+#include "components/user_manager/user_id.h"
#include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_data.h"
#include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_formatter.h"
@@ -310,11 +311,11 @@ void PersonalDataManager::OnWebDataServiceRequestDone(
&server_profiles_);
if (!server_profiles_.empty()) {
- std::string account_id =
- pref_service_->GetString(::prefs::kGoogleServicesAccountId);
+ const user_manager::UserID user_id(user_manager::UserID::FromUserEmail(
+ pref_service_->GetString(::prefs::kGoogleServicesAccountId)));
base::string16 email =
base::UTF8ToUTF16(
- account_tracker_->GetAccountInfo(account_id).email);
+ account_tracker_->GetAccountInfo(user_id.GetUserEmail()).email);
DCHECK(!email.empty());
for (AutofillProfile* profile : server_profiles_)
profile->SetRawInfo(EMAIL_ADDRESS, email);

Powered by Google App Engine
This is Rietveld 408576698