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

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

Issue 396773002: [Profiles] Create a profile moar better after deleting the only existing profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: undo changes to TestingProfile because they broke everything Created 6 years, 5 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 | chrome/browser/profiles/profile_manager_unittest.cc » ('j') | 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 686e3025bf084cab2548364a9e2071f5b20296e1..2992720711a8b9b6562efd128966109856a1817f 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -650,8 +650,11 @@ void ProfileManager::ScheduleProfileForDeletion(
PrefService* local_state = g_browser_process->local_state();
ProfileInfoCache& cache = GetProfileInfoCache();
- if (profile_dir.BaseName().MaybeAsASCII() ==
- local_state->GetString(prefs::kProfileLastUsed)) {
+ const std::string last_used_profile =
+ local_state->GetString(prefs::kProfileLastUsed);
+
+ if (last_used_profile == profile_dir.BaseName().MaybeAsASCII() ||
+ last_used_profile == GetGuestProfilePath().BaseName().MaybeAsASCII()) {
// Update the last used profile pref before closing browser windows. This
// way the correct last used profile is set for any notification observers.
base::FilePath last_non_supervised_profile_path;
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698