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

Unified Diff: chrome/browser/ui/app_list/app_list_util.cc

Issue 12090062: Enable profile switching for standalone App Launcher via the Settings App. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: disable tests on aura Created 7 years, 10 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/ui/app_list/app_list_util.h ('k') | chrome/browser/ui/app_list/app_list_view_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/app_list_util.cc
diff --git a/chrome/browser/ui/app_list/app_list_util.cc b/chrome/browser/ui/app_list/app_list_util.cc
index bda19ce0922853b6386653027dcce8fde4c048a9..de396d52b7bef2283331bb9c4f46b6dba9e7deaa 100644
--- a/chrome/browser/ui/app_list/app_list_util.cc
+++ b/chrome/browser/ui/app_list/app_list_util.cc
@@ -4,13 +4,47 @@
#include "chrome/browser/ui/app_list/app_list_util.h"
+#include "base/file_util.h"
#include "build/build_config.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/extensions/extension_prefs.h"
+#include "chrome/browser/prefs/pref_service.h"
+#include "chrome/common/chrome_constants.h"
+#include "chrome/common/pref_names.h"
namespace chrome {
#if defined(OS_CHROMEOS)
// Default implementation for ports which do not have this implemented.
-void InitAppList() {}
+void InitAppList(Profile* profile) {}
#endif
+#if defined(ENABLE_APP_LIST)
+FilePath GetAppListProfilePath(const FilePath& user_data_dir) {
+ PrefService* local_state = g_browser_process->local_state();
+ DCHECK(local_state);
+
+ std::string app_list_profile;
+ if (local_state->HasPrefPath(prefs::kAppListProfile))
+ app_list_profile = local_state->GetString(prefs::kAppListProfile);
+
+ // If the user has no profile preference for the app launcher, default to the
+ // last browser profile used.
+ if (app_list_profile.empty() &&
+ local_state->HasPrefPath(prefs::kProfileLastUsed))
+ app_list_profile = local_state->GetString(prefs::kProfileLastUsed);
+
+ std::string profile_path = app_list_profile.empty() ?
+ chrome::kInitialProfile :
+ app_list_profile;
+
+ return user_data_dir.AppendASCII(profile_path);
+}
+
+void RegisterAppListPrefs(PrefServiceSimple* prefs) {
+ prefs->RegisterStringPref(prefs::kAppListProfile, "");
+}
+#endif // defined(ENABLE_APP_LIST)
+
+
} // namespace chrome
« no previous file with comments | « chrome/browser/ui/app_list/app_list_util.h ('k') | chrome/browser/ui/app_list/app_list_view_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698