Commit bbb18405 authored by skuhne@chromium.org's avatar skuhne@chromium.org

Removal of GetDefaultProfile from UserManagerImpl

BUG=322682
TEST=covered by existing unit tests

Review URL: https://codereview.chromium.org/127963004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243860 0039d316-1c4b-4281-b951-d872f2087c98
parent c9fdbdb7
...@@ -609,10 +609,10 @@ Profile* UserManagerImpl::GetProfileByUser(const User* user) const { ...@@ -609,10 +609,10 @@ Profile* UserManagerImpl::GetProfileByUser(const User* user) const {
if (IsMultipleProfilesAllowed() && user->is_profile_created()) if (IsMultipleProfilesAllowed() && user->is_profile_created())
profile = ProfileHelper::GetProfileByUserIdHash(user->username_hash()); profile = ProfileHelper::GetProfileByUserIdHash(user->username_hash());
else else
profile = g_browser_process->profile_manager()->GetDefaultProfile(); profile = ProfileManager::GetActiveUserProfile();
// GetDefaultProfile() or GetProfileByUserIdHash() returns a new instance of // GetActiveUserProfile() or GetProfileByUserIdHash() returns a new instance
// ProfileImpl(), but actually its OffTheRecordProfile() should be used. // of ProfileImpl(), but actually its OffTheRecordProfile() should be used.
if (profile && IsLoggedInAsGuest()) if (profile && IsLoggedInAsGuest())
profile = profile->GetOffTheRecordProfile(); profile = profile->GetOffTheRecordProfile();
return profile; return profile;
......
...@@ -418,7 +418,9 @@ Profile* ProfileManager::GetPrimaryUserProfile() { ...@@ -418,7 +418,9 @@ Profile* ProfileManager::GetPrimaryUserProfile() {
Profile* ProfileManager::GetActiveUserProfile() { Profile* ProfileManager::GetActiveUserProfile() {
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
ProfileManager* profile_manager = g_browser_process->profile_manager(); ProfileManager* profile_manager = g_browser_process->profile_manager();
if (!profile_manager->IsLoggedIn() || !chromeos::UserManager::IsInitialized()) if (!chromeos::UserManager::IsMultipleProfilesAllowed() ||
!profile_manager->IsLoggedIn() ||
!chromeos::UserManager::IsInitialized())
return GetDefaultProfile(); return GetDefaultProfile();
chromeos::UserManager* manager = chromeos::UserManager::Get(); chromeos::UserManager* manager = chromeos::UserManager::Get();
// Note: The user manager will take care of guest profiles. // Note: The user manager will take care of guest profiles.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment