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

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

Issue 11667024: Do not return profile unless it is loaded (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Also fix ToDo 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
« no previous file with comments | « chrome/browser/profiles/profile_manager.h ('k') | no next file » | 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 a9e14b6e51b706979cf1906a0e34ae4595e48145..17cfeef34f0fc54afc1f50c2cf5051c8e04c56b8 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -362,6 +362,12 @@ Profile* ProfileManager::GetDefaultProfile(const FilePath& user_data_dir) {
return profile->GetOffTheRecordProfile();
return profile;
}
+
+ 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)
+ default_profile_dir = GetDefaultProfileDir(user_data_dir);
#endif
return GetProfile(default_profile_dir);
}
@@ -489,9 +495,15 @@ ProfileManager::ProfileInfo* ProfileManager::RegisterProfile(
return info;
}
-Profile* ProfileManager::GetProfileByPath(const FilePath& path) const {
+ProfileManager::ProfileInfo* ProfileManager::GetProfileInfoByPath(
+ const FilePath& path) const {
ProfilesInfoMap::const_iterator iter = profiles_info_.find(path);
- return (iter == profiles_info_.end()) ? NULL : iter->second->profile.get();
+ return (iter == profiles_info_.end()) ? NULL : iter->second.get();
+}
+
+Profile* ProfileManager::GetProfileByPath(const FilePath& path) const {
+ ProfileInfo* profile_info = GetProfileInfoByPath(path);
+ return profile_info ? profile_info->profile.get() : NULL;
}
// static
« no previous file with comments | « chrome/browser/profiles/profile_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698