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

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

Issue 2538753002: Profile deletion: forbid fallback to guest profile. (Closed)
Patch Set: Created 4 years, 1 month 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 df347ab62e724930250e25ea66aa0eaa10c82f56..c05003344d63274343f5b7c5249adf0e37c064ed 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -1316,8 +1316,9 @@ void ProfileManager::EnsureActiveProfileExistsBeforeDeletion(
// In case we delete non-active profile, just proceed.
const base::FilePath last_used_profile =
GetLastUsedProfileDir(user_data_dir_);
+ const base::FilePath guest_profile_path = GetGuestProfilePath();
if (last_used_profile != profile_dir &&
- last_used_profile != GetGuestProfilePath()) {
+ last_used_profile != guest_profile_path) {
FinishDeletingProfile(profile_dir, last_used_profile);
return;
}
@@ -1327,6 +1328,7 @@ void ProfileManager::EnsureActiveProfileExistsBeforeDeletion(
Profile* profile = browser->profile();
base::FilePath cur_path = profile->GetPath();
if (cur_path != profile_dir &&
+ cur_path != guest_profile_path &&
!profile->IsLegacySupervised() &&
!IsProfileDirectoryMarkedForDeletion(cur_path)) {
OnNewActiveProfileLoaded(profile_dir, cur_path, callback, profile,
@@ -1345,6 +1347,7 @@ void ProfileManager::EnsureActiveProfileExistsBeforeDeletion(
// Make sure that this profile is not pending deletion, and is not
// legacy-supervised.
if (cur_path != profile_dir &&
+ cur_path != guest_profile_path &&
!entry->IsLegacySupervised() &&
!IsProfileDirectoryMarkedForDeletion(cur_path)) {
fallback_profile_path = cur_path;
« 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