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

Unified Diff: chrome/browser/chromeos/profiles/profile_helper.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: chrome/browser/chromeos/profiles/profile_helper.cc
diff --git a/chrome/browser/chromeos/profiles/profile_helper.cc b/chrome/browser/chromeos/profiles/profile_helper.cc
index cb7f6e2f444fa587de2df77f9f6284778b49a179..1effa5188575a27c19a17feff9d0d7fba9402ac5 100644
--- a/chrome/browser/chromeos/profiles/profile_helper.cc
+++ b/chrome/browser/chromeos/profiles/profile_helper.cc
@@ -166,7 +166,7 @@ bool ProfileHelper::IsOwnerProfile(Profile* profile) {
if (!user)
return false;
- return user->email() == user_manager::UserManager::Get()->GetOwnerEmail();
+ return user->GetUserID() == user_manager::UserManager::Get()->GetOwnerID();
}
// static
@@ -281,7 +281,7 @@ Profile* ProfileHelper::GetProfileByUserUnsafe(const user_manager::User* user) {
"|user|'s profile is not created. It probably means that "
"something is wrong with a calling code. Please report in "
"http://crbug.com/361528 if you see this message. user_id: "
- << user->email();
+ << user->GetUserID().GetUserEmail();
profile = ProfileManager::GetActiveUserProfile();
}
@@ -299,12 +299,12 @@ const user_manager::User* ProfileHelper::GetUserByProfile(
if (always_return_primary_user_for_testing)
return user_manager::UserManager::Get()->GetPrimaryUser();
- const std::string& user_name = profile->GetProfileUserName();
+ const user_manager::UserID user_id = user_manager::UserID::FromUserEmail(profile->GetProfileUserName());
for (user_manager::UserList::const_iterator it =
user_list_for_testing_.begin();
it != user_list_for_testing_.end();
++it) {
- if ((*it)->email() == user_name)
+ if ((*it)->GetUserID() == user_id)
return *it;
}

Powered by Google App Engine
This is Rietveld 408576698