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

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: nico's comment + fix tests 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
« no previous file with comments | « chrome/browser/profiles/profile_manager.h ('k') | 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 0f2292dfed810a657571a2e7d6ba828939e9076c..c9a11303d2003a742bd791356a574ec7dfeb76e7 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -596,7 +596,17 @@ base::FilePath ProfileManager::GetGuestProfilePath() {
ProfileManager* profile_manager = g_browser_process->profile_manager();
base::FilePath guest_path = profile_manager->user_data_dir();
- return guest_path.Append(chrome::kGuestProfileDir);
+ return guest_path.AppendASCII(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.AppendASCII(chrome::kUserManagerProfileDir);
}
base::FilePath ProfileManager::GenerateNextProfileDirectoryPath() {
@@ -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())
« no previous file with comments | « chrome/browser/profiles/profile_manager.h ('k') | chrome/browser/profiles/profile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698