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

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: No more need for NotifyProfileCreated 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
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..67ae6dd6ffca80a568412cd1e7609b8de50c465e 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 actual initial profile, if profile for user was not fully
Nikita (slow) 2013/01/09 13:54:33 nit: "actual initial profile" > "default OTR login
Denis Kuznetsov (DE-MUC) 2013/01/09 14:10:49 Done.
+ // 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
« chrome/browser/profiles/profile_manager.h ('K') | « chrome/browser/profiles/profile_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698