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

Unified Diff: chrome/test/base/testing_profile.cc

Issue 2928823003: Make it possible to build without enable_supervised_users.
Patch Set: Does it still compile with the feature enabled? 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/test/base/testing_profile.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/testing_profile.cc
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index f67cb42419726a1f737fb6b8d364ddf36fd2d2bf..a424fb3e4ddabc2c57ca1395f4f096e70ebb95f9 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -467,14 +467,17 @@ void TestingProfile::Init() {
}
#endif
- if (prefs_.get())
+ if (prefs_.get()) {
user_prefs::UserPrefs::Set(this, prefs_.get());
- else if (IsOffTheRecord())
+ } else if (IsOffTheRecord()) {
CreateIncognitoPrefService();
- else if (!supervised_user_id_.empty())
+ } else if (!supervised_user_id_.empty()) {
+#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
CreatePrefServiceForSupervisedUser();
- else
+#endif
+ } else {
CreateTestingPrefService();
+ }
if (!base::PathExists(profile_path_))
base::CreateDirectory(profile_path_);
@@ -803,6 +806,7 @@ void TestingProfile::CreateTestingPrefService() {
chrome::RegisterUserProfilePrefs(testing_prefs_->registry());
}
+#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
void TestingProfile::CreatePrefServiceForSupervisedUser() {
DCHECK(!prefs_.get());
DCHECK(!supervised_user_id_.empty());
@@ -821,6 +825,7 @@ void TestingProfile::CreatePrefServiceForSupervisedUser() {
chrome::RegisterUserProfilePrefs(registry.get());
user_prefs::UserPrefs::Set(this, prefs_.get());
}
+#endif
void TestingProfile::CreateIncognitoPrefService() {
DCHECK(original_profile_);
« no previous file with comments | « chrome/test/base/testing_profile.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698