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

Unified Diff: chrome/browser/browser_main.cc

Issue 7467008: Add a command line "--profile-directory="name of profile directory to load"" switch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_main.cc
===================================================================
--- chrome/browser/browser_main.cc (revision 93222)
+++ chrome/browser/browser_main.cc (working copy)
@@ -897,10 +897,22 @@
// fallback profile. Returns the newly created profile, or NULL if startup
// should not continue.
Profile* CreateProfile(const MainFunctionParams& parameters,
- const FilePath& user_data_dir) {
- Profile* profile = ProfileManager::IsMultipleProfilesEnabled() ?
- g_browser_process->profile_manager()->GetLastUsedProfile(user_data_dir) :
- g_browser_process->profile_manager()->GetDefaultProfile(user_data_dir);
+ const FilePath& user_data_dir,
+ const CommandLine& parsed_command_line) {
+ Profile* profile;
+ if (ProfileManager::IsMultipleProfilesEnabled()) {
+ if (parsed_command_line.HasSwitch(switches::kProfileDirectory)) {
+ g_browser_process->local_state()->SetString(prefs::kProfileLastUsed,
+ parsed_command_line.GetSwitchValueASCII(
+ switches::kProfileDirectory));
+ }
+ profile = g_browser_process->profile_manager()->GetLastUsedProfile(
+ user_data_dir);
+ } else {
+ profile = g_browser_process->profile_manager()->GetDefaultProfile(
+ user_data_dir);
+ }
+
if (profile)
return profile;
@@ -1656,7 +1668,8 @@
}
#endif
- Profile* profile = CreateProfile(parameters, user_data_dir);
+ Profile* profile = CreateProfile(parameters, user_data_dir,
+ parsed_command_line);
if (!profile)
return content::RESULT_CODE_NORMAL_EXIT;
« no previous file with comments | « no previous file | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698