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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 129293002: Removing GetDefaultProfileOrOffTheRecord and GetDefaultProfile(<path>) from ProfileManager's (publi… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed comment Created 6 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
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 7271cb814faaa0fb3d33d6db8e5671634bb5f5de..cddf4723c7b4c343794dc7178cbcbad788311cb2 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -320,12 +320,12 @@ base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir,
user_data_dir);
}
-// Initializes the profile, possibly doing some user prompting to pick a
-// fallback profile. Returns the newly created profile, or NULL if startup
+// Initializes the primary profile, possibly doing some user prompting to pick
+// a fallback profile. Returns the newly created profile, or NULL if startup
// should not continue.
-Profile* CreateProfile(const content::MainFunctionParams& parameters,
- const base::FilePath& user_data_dir,
- const CommandLine& parsed_command_line) {
+Profile* CreatePrimaryProfile(const content::MainFunctionParams& parameters,
+ const base::FilePath& user_data_dir,
+ const CommandLine& parsed_command_line) {
TRACE_EVENT0("startup", "ChromeBrowserMainParts::CreateProfile")
base::Time start = base::Time::Now();
if (profiles::IsMultipleProfilesEnabled() &&
@@ -342,9 +342,12 @@ Profile* CreateProfile(const content::MainFunctionParams& parameters,
Profile* profile = NULL;
#if defined(OS_CHROMEOS)
- // TODO(ivankr): http://crbug.com/83792
- profile = g_browser_process->profile_manager()->GetDefaultProfile(
- user_data_dir);
+ // On ChromeOS the ProfileManager will use the same path as the one we got
+ // passed. GetActiveUserProfile will therefore use the correct path
+ // automatically.
+ DCHECK_EQ(user_data_dir.value(),
+ g_browser_process->profile_manager()->user_data_dir().value());
+ profile = ProfileManager::GetActiveUserProfile();
#else
base::FilePath profile_path =
GetStartupProfilePath(user_data_dir, parsed_command_line);
@@ -1249,7 +1252,9 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
// Profile creation ----------------------------------------------------------
MetricsService::SetExecutionPhase(MetricsService::CREATE_PROFILE);
- profile_ = CreateProfile(parameters(), user_data_dir_, parsed_command_line());
+ profile_ = CreatePrimaryProfile(parameters(),
+ user_data_dir_,
+ parsed_command_line());
if (!profile_)
return content::RESULT_CODE_NORMAL_EXIT;
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698