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

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

Issue 239543012: The User Manager should be backed by a special profile, not the guest one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
Index: chrome/browser/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 0f2292dfed810a657571a2e7d6ba828939e9076c..b4df47d887fac0ed284bc38c6c4976a6c0708444 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -599,6 +599,16 @@ base::FilePath ProfileManager::GetGuestProfilePath() {
return guest_path.Append(chrome::kGuestProfileDir);
}
+// static
+base::FilePath ProfileManager::GetUserManagerProfilePath() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ ProfileManager* profile_manager = g_browser_process->profile_manager();
+
+ base::FilePath profile_path = profile_manager->user_data_dir();
+ return profile_path.Append(chrome::kUserManagerProfileDir);
+}
+
base::FilePath ProfileManager::GenerateNextProfileDirectoryPath() {
PrefService* local_state = g_browser_process->local_state();
DCHECK(local_state);
@@ -1120,7 +1130,9 @@ ProfileManager::ProfileInfo* ProfileManager::GetProfileInfoByPath(
}
void ProfileManager::AddProfileToCache(Profile* profile) {
- if (profile->IsGuestSession())
+ // Don't add guest profiles or the generic user manager profile to the cache.
+ if (profile->IsGuestSession() ||
+ profile->GetPath() == ProfileManager::GetUserManagerProfilePath())
return;
ProfileInfoCache& cache = GetProfileInfoCache();
if (profile->GetPath().DirName() != cache.GetUserDataDir())

Powered by Google App Engine
This is Rietveld 408576698