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

Unified Diff: chrome/browser/notifications/notifier_state_tracker.cc

Issue 2479593006: Move enable extensions define to a build flag. (Closed)
Patch Set: Merge Created 4 years, 1 month 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/notifications/notifier_state_tracker.cc
diff --git a/chrome/browser/notifications/notifier_state_tracker.cc b/chrome/browser/notifications/notifier_state_tracker.cc
index 3d0c4a4d236181760a5d2e3ececdb12c24fbe228..9e3180d1d4a123d8ef85ca7ffe5fc1fb8add175a 100644
--- a/chrome/browser/notifications/notifier_state_tracker.cc
+++ b/chrome/browser/notifications/notifier_state_tracker.cc
@@ -17,9 +17,10 @@
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "content/public/browser/permission_type.h"
+#include "extensions/features/features.h"
#include "ui/message_center/notifier_settings.h"
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/common/extensions/api/notifications.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/event_router.h"
@@ -40,7 +41,7 @@ void NotifierStateTracker::RegisterProfilePrefs(
NotifierStateTracker::NotifierStateTracker(Profile* profile)
: profile_(profile)
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
,
extension_registry_observer_(this)
#endif
@@ -69,7 +70,7 @@ NotifierStateTracker::NotifierStateTracker(Profile* profile)
base::Unretained(prefs::kMessageCenterDisabledSystemComponentIds),
base::Unretained(&disabled_system_component_ids_)));
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
extension_registry_observer_.Add(
extensions::ExtensionRegistry::Get(profile_));
#endif
@@ -126,7 +127,7 @@ void NotifierStateTracker::SetNotifierEnabled(
pref_name = prefs::kMessageCenterDisabledExtensionIds;
add_new_item = !enabled;
id.reset(new base::StringValue(notifier_id.id));
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
FirePermissionLevelChangedEvent(notifier_id, enabled);
#endif
break;
@@ -169,7 +170,7 @@ void NotifierStateTracker::OnStringListPrefChanged(
}
}
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
void NotifierStateTracker::OnExtensionUninstalled(
content::BrowserContext* browser_context,
const extensions::Extension* extension,

Powered by Google App Engine
This is Rietveld 408576698