Index: chrome/browser/supervised_user/supervised_user_service.cc |
diff --git a/chrome/browser/supervised_user/supervised_user_service.cc b/chrome/browser/supervised_user/supervised_user_service.cc |
index 68d04894ce2e5bb0c327f6efe719dcb4bd8d6eac..724097ef6061a54c6becde404385fc67a3b23b30 100644 |
--- a/chrome/browser/supervised_user/supervised_user_service.cc |
+++ b/chrome/browser/supervised_user/supervised_user_service.cc |
@@ -51,6 +51,7 @@ |
#include "components/signin/core/common/signin_switches.h" |
#include "content/public/browser/browser_thread.h" |
#include "content/public/browser/user_metrics.h" |
+#include "extensions/features/features.h" |
#include "ui/base/l10n/l10n_util.h" |
#if !defined(OS_ANDROID) |
@@ -69,7 +70,7 @@ |
#include "components/user_manager/user_manager.h" |
#endif |
-#if defined(ENABLE_EXTENSIONS) |
+#if BUILDFLAG(ENABLE_EXTENSIONS) |
#include "chrome/browser/extensions/extension_service.h" |
#include "chrome/browser/extensions/extension_util.h" |
#include "extensions/browser/extension_prefs.h" |
@@ -86,14 +87,14 @@ using base::DictionaryValue; |
using base::UserMetricsAction; |
using content::BrowserThread; |
-#if defined(ENABLE_EXTENSIONS) |
+#if BUILDFLAG(ENABLE_EXTENSIONS) |
using extensions::Extension; |
using extensions::ExtensionPrefs; |
using extensions::ExtensionRegistry; |
using extensions::ExtensionSystem; |
#endif |
-#if defined(ENABLE_EXTENSIONS) |
+#if BUILDFLAG(ENABLE_EXTENSIONS) |
using extensions::ExtensionPrefs; |
#endif |
@@ -537,12 +538,12 @@ SupervisedUserService::SupervisedUserService(Profile* profile) |
did_init_(false), |
did_shutdown_(false), |
blacklist_state_(BlacklistLoadState::NOT_LOADED), |
-#if defined(ENABLE_EXTENSIONS) |
+#if BUILDFLAG(ENABLE_EXTENSIONS) |
registry_observer_(this), |
#endif |
weak_ptr_factory_(this) { |
url_filter_context_.ui_url_filter()->AddObserver(this); |
-#if defined(ENABLE_EXTENSIONS) |
+#if BUILDFLAG(ENABLE_EXTENSIONS) |
registry_observer_.Add(extensions::ExtensionRegistry::Get(profile)); |
#endif |
} |
@@ -600,7 +601,7 @@ void SupervisedUserService::SetActive(bool active) { |
GetSettingsService()->SetActive(active_); |
-#if defined(ENABLE_EXTENSIONS) |
+#if BUILDFLAG(ENABLE_EXTENSIONS) |
SetExtensionsActive(); |
#endif |
@@ -609,7 +610,7 @@ void SupervisedUserService::SetActive(bool active) { |
prefs::kDefaultSupervisedUserFilteringBehavior, |
base::Bind(&SupervisedUserService::OnDefaultFilteringBehaviorChanged, |
base::Unretained(this))); |
-#if defined(ENABLE_EXTENSIONS) |
+#if BUILDFLAG(ENABLE_EXTENSIONS) |
pref_change_registrar_.Add( |
prefs::kSupervisedUserApprovedExtensions, |
base::Bind(&SupervisedUserService::UpdateApprovedExtensions, |
@@ -637,7 +638,7 @@ void SupervisedUserService::SetActive(bool active) { |
UpdateManualHosts(); |
UpdateManualURLs(); |
-#if defined(ENABLE_EXTENSIONS) |
+#if BUILDFLAG(ENABLE_EXTENSIONS) |
UpdateApprovedExtensions(); |
#endif |
@@ -652,7 +653,7 @@ void SupervisedUserService::SetActive(bool active) { |
pref_change_registrar_.Remove( |
prefs::kDefaultSupervisedUserFilteringBehavior); |
-#if defined(ENABLE_EXTENSIONS) |
+#if BUILDFLAG(ENABLE_EXTENSIONS) |
pref_change_registrar_.Remove(prefs::kSupervisedUserApprovedExtensions); |
#endif |
pref_change_registrar_.Remove(prefs::kSupervisedUserManualHosts); |
@@ -990,7 +991,7 @@ void SupervisedUserService::Shutdown() { |
sync_service->RemovePreferenceProvider(this); |
} |
-#if defined(ENABLE_EXTENSIONS) |
+#if BUILDFLAG(ENABLE_EXTENSIONS) |
SupervisedUserService::ExtensionState SupervisedUserService::GetExtensionState( |
const Extension& extension) const { |
bool was_installed_by_default = extension.was_installed_by_default(); |
@@ -1240,7 +1241,7 @@ void SupervisedUserService::SetExtensionsActive() { |
extension_system->extension_service()->CheckManagementPolicy(); |
} |
} |
-#endif // defined(ENABLE_EXTENSIONS) |
+#endif // BUILDFLAG(ENABLE_EXTENSIONS) |
syncer::ModelTypeSet SupervisedUserService::GetPreferredDataTypes() const { |
if (!ProfileIsSupervised()) |