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

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

Issue 15702004: Open Ash shell after creating Profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address feedback Created 7 years, 7 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 ca55479b0a93cb25136fb86aa62cdcdbeb2011ad..24084c6b59af73d79066483a2844504b740121cb 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -230,9 +230,24 @@ void ProfileManager::NukeDeletedProfilesFromDisk() {
ProfilesToDelete().clear();
}
+namespace {
+
+// Assume "allowed" for tests; SetAllowGetDefaultProfile(false) should be called
Paweł Hajdan Jr. 2013/05/23 20:33:25 Let's make it stronger: false should be the defaul
+// early to enable checking, e.g. from ChromeBrowserMainParts.
+bool s_allow_get_default_profile = true;
+
+} // namespace
+
+// static
+void ProfileManager::SetAllowGetDefaultProfile(bool allow) {
+ s_allow_get_default_profile = allow;
+}
+
// static
// TODO(nkostylev): Remove this method once all clients are migrated.
Profile* ProfileManager::GetDefaultProfile() {
+ CHECK(s_allow_get_default_profile)
+ << "GetDefaultProfile() caled befofre allowed.";
ProfileManager* profile_manager = g_browser_process->profile_manager();
return profile_manager->GetDefaultProfile(profile_manager->user_data_dir_);
}
@@ -240,6 +255,8 @@ Profile* ProfileManager::GetDefaultProfile() {
// static
// TODO(nkostylev): Remove this method once all clients are migrated.
Profile* ProfileManager::GetDefaultProfileOrOffTheRecord() {
+ CHECK(s_allow_get_default_profile)
+ << "GetDefaultProfileOrOffTheRecord() caled befofre allowed.";
// TODO (mukai,nkostylev): In the long term we should fix those cases that
// crash on Guest mode and have only one GetDefaultProfile() method.
Profile* profile = GetDefaultProfile();
« no previous file with comments | « chrome/browser/profiles/profile_manager.h ('k') | chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698