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

Unified Diff: chrome/browser/chromeos/profiles/profile_helper.cc

Issue 2587853003: cros: Fix CrashRestoreComplexTest failure (Closed)
Patch Set: add comment Created 4 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 96fef2b37369d61d85421d2508070d2069fe7ef4..22876498d711b231166f27b449c13362e06fa615 100644
--- a/chrome/browser/chromeos/profiles/profile_helper.cc
+++ b/chrome/browser/chromeos/profiles/profile_helper.cc
@@ -366,9 +366,11 @@ const user_manager::User* ProfileHelper::GetUserByProfile(
return user_manager->GetActiveUser();
}
+ // Finds the matching user in logged-in user list since only a logged-in
+ // user would have a profile.
const std::string username_hash =
ProfileHelper::GetUserIdHashFromProfile(profile);
- const user_manager::UserList& users = user_manager->GetUsers();
+ const user_manager::UserList& users = user_manager->GetLoggedInUsers();
const user_manager::UserList::const_iterator pos = std::find_if(
users.begin(), users.end(), UsernameHashMatcher(username_hash));
if (pos != users.end())
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698