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

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

Issue 11968034: Enable profile switching for standalone App Launcher via the Settings App. (Closed) Base URL: git://nomatter.syd/chromium/src.git@master
Patch Set: Created 7 years, 11 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 714c2883aa4fb51c8e8260838dcdd9d41b9d6c9c..829ee8305c5c2e9cbede2fc7befbace9c7a7e7b5 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -323,6 +323,20 @@ Profile* ProfileManager::GetLastUsedProfile(const FilePath& user_data_dir) {
return GetProfile(last_used_profile_dir);
}
+Profile* ProfileManager::GetAppListProfile(const FilePath& user_data_dir) {
+ FilePath app_list_profile_dir(user_data_dir);
+ std::string app_list_profile;
+ PrefService* local_state = g_browser_process->local_state();
+ DCHECK(local_state);
+
+ if (local_state->HasPrefPath(prefs::kAppListProfile))
+ app_list_profile = local_state->GetString(prefs::kAppListProfile);
+ app_list_profile_dir = app_list_profile.empty() ?
+ app_list_profile_dir.AppendASCII(chrome::kInitialProfile) :
tapted 2013/01/17 04:23:31 Should this (as an extra step) first check prefs::
koz (OOO until 15th September) 2013/01/18 05:37:33 That's a good idea. Done.
+ app_list_profile_dir.AppendASCII(app_list_profile);
+ return GetProfile(app_list_profile_dir);
+}
+
std::vector<Profile*> ProfileManager::GetLastOpenedProfiles(
const FilePath& user_data_dir) {
PrefService* local_state = g_browser_process->local_state();
@@ -840,6 +854,7 @@ void ProfileManager::CreateMultiProfileAsync(
// static
void ProfileManager::RegisterPrefs(PrefServiceSimple* prefs) {
+ prefs->RegisterStringPref(prefs::kAppListProfile, "");
prefs->RegisterStringPref(prefs::kProfileLastUsed, "");
prefs->RegisterIntegerPref(prefs::kProfilesNumCreated, 1);
prefs->RegisterListPref(prefs::kProfilesLastActive);

Powered by Google App Engine
This is Rietveld 408576698