Commit e4bc3e8a authored by kaliamoorthi's avatar kaliamoorthi Committed by Commit bot

Use last active profile instead of default profile in profile manager

When profiles are deleted, new profiles are created in the directory
Profile X. These directories are stored in last active profile. In metro
mode, on initialization rather than last active profile, default profile
corresponding to the directory Default is used resulting in problems
on profile deletion. This CL makes ProfileManager::GetActiveUserProfile
return last active profile instead of default profile for windows build
to solve the problem.

BUG=450192

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

Cr-Commit-Position: refs/heads/master@{#325440}
parent bfffb22e
...@@ -356,6 +356,7 @@ Profile* ProfileManager::GetActiveUserProfile() { ...@@ -356,6 +356,7 @@ Profile* ProfileManager::GetActiveUserProfile() {
return chromeos::ProfileHelper::Get()->GetProfileByUserUnsafe(user); return chromeos::ProfileHelper::Get()->GetProfileByUserUnsafe(user);
#endif #endif
#if !defined(OS_WIN)
Profile* profile = Profile* profile =
profile_manager->GetActiveUserOrOffTheRecordProfileFromPath( profile_manager->GetActiveUserOrOffTheRecordProfileFromPath(
profile_manager->user_data_dir()); profile_manager->user_data_dir());
...@@ -366,6 +367,10 @@ Profile* ProfileManager::GetActiveUserProfile() { ...@@ -366,6 +367,10 @@ Profile* ProfileManager::GetActiveUserProfile() {
// figure out how common this is. http://crbug.com/383019 // figure out how common this is. http://crbug.com/383019
CHECK(profile) << profile_manager->user_data_dir().AsUTF8Unsafe(); CHECK(profile) << profile_manager->user_data_dir().AsUTF8Unsafe();
return profile; return profile;
#else
return profile_manager->GetProfile(
profile_manager->GetLastUsedProfileDir(profile_manager->user_data_dir()));
#endif
} }
Profile* ProfileManager::GetProfile(const base::FilePath& profile_dir) { Profile* ProfileManager::GetProfile(const base::FilePath& profile_dir) {
......
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