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

Unified Diff: chrome/browser/profiles/profile_manager.cc

Issue 2694813004: Upon deletion of the profile don't fallback on current if it supervised. (Closed)
Patch Set: Created 3 years, 10 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
« 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/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index ab192042a61a91916d88f323d8ecfcc69f7a4338..e18262cdbaeb8c548b0026867703d16b8e909ac8 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -1367,13 +1367,16 @@ Profile* ProfileManager::CreateAndInitializeProfile(
#if !defined(OS_ANDROID)
void ProfileManager::EnsureActiveProfileExistsBeforeDeletion(
const CreateCallback& callback, const base::FilePath& profile_dir) {
- // In case we delete non-active profile, just proceed.
- const base::FilePath last_used_profile =
+ // In case we delete non-active profile and current profile is valid, proceed.
+ const base::FilePath last_used_profile_path =
GetLastUsedProfileDir(user_data_dir_);
const base::FilePath guest_profile_path = GetGuestProfilePath();
- if (last_used_profile != profile_dir &&
- last_used_profile != guest_profile_path) {
- FinishDeletingProfile(profile_dir, last_used_profile);
+ Profile* last_used_profile = GetProfileByPath(last_used_profile_path);
+ if (last_used_profile_path != profile_dir &&
+ last_used_profile_path != guest_profile_path &&
+ last_used_profile != nullptr &&
+ !last_used_profile->IsLegacySupervised()) {
+ FinishDeletingProfile(profile_dir, last_used_profile_path);
return;
}
« 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