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

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

Issue 2918203002: cros: Fix loading user profile w/o UserSessionManager (Closed)
Patch Set: rebase Created 3 years, 6 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 037d706848990afbb50a0c62ec1329e4e6eed802..64cf9463eef32b3713d233f70df0aad01690750e 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -487,6 +487,13 @@ Profile* ProfileManager::GetActiveUserProfile() {
return profile;
}
+// static
+Profile* ProfileManager::CreateInitialProfile() {
+ ProfileManager* const profile_manager = g_browser_process->profile_manager();
+ return profile_manager->GetProfile(profile_manager->user_data_dir().Append(
+ profile_manager->GetInitialProfileDir()));
+}
+
Profile* ProfileManager::GetProfile(const base::FilePath& profile_dir) {
TRACE_EVENT0("browser", "ProfileManager::GetProfile");
@@ -638,8 +645,8 @@ Profile* ProfileManager::GetLastUsedProfile(
// If we get here, it means the user has logged in but the profile has not
// finished initializing, so treat the user as not having logged in.
if (!profile) {
- DLOG(WARNING) << "Calling GetLastUsedProfile() before profile "
- << "initialization is completed. Returning login profile.";
+ LOG(WARNING) << "Calling GetLastUsedProfile() before profile "
+ << "initialization is completed. Returning login profile.";
return GetActiveUserOrOffTheRecordProfileFromPath(user_data_dir);
}
return profile->IsGuestSession() ? profile->GetOffTheRecordProfile() :
@@ -1322,9 +1329,9 @@ Profile* ProfileManager::GetActiveUserOrOffTheRecordProfileFromPath(
default_profile_dir = default_profile_dir.Append(GetInitialProfileDir());
ProfileInfo* profile_info = GetProfileInfoByPath(default_profile_dir);
- // Fallback to default off-the-record profile, if user profile has not fully
- // loaded yet.
- if (profile_info && !profile_info->created)
+ // Fallback to default off-the-record profile, if user profile has not started
+ // loading or has not fully loaded yet.
+ if (!profile_info || !profile_info->created)
default_profile_dir = profiles::GetDefaultProfileDir(user_data_dir);
Profile* profile = GetProfile(default_profile_dir);
« 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