Index: chrome/browser/notifications/desktop_notification_service.cc |
diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc |
index c53742b75fb2f626fc4704d57af2862bf9b577f7..d8177434cd2e87f278d02a2cc612690f92d5dd01 100644 |
--- a/chrome/browser/notifications/desktop_notification_service.cc |
+++ b/chrome/browser/notifications/desktop_notification_service.cc |
@@ -98,7 +98,9 @@ std::string DesktopNotificationService::AddIconNotification( |
DesktopNotificationService::DesktopNotificationService(Profile* profile) |
: PermissionContextBase(profile, CONTENT_SETTINGS_TYPE_NOTIFICATIONS), |
profile_(profile), |
+#if defined(ENABLE_EXTENSIONS) |
extension_registry_observer_(this), |
+#endif |
weak_factory_(this) { |
OnStringListPrefChanged( |
prefs::kMessageCenterDisabledExtensionIds, &disabled_extension_ids_); |
@@ -121,8 +123,10 @@ DesktopNotificationService::DesktopNotificationService(Profile* profile) |
base::Unretained(this), |
base::Unretained(prefs::kMessageCenterDisabledSystemComponentIds), |
base::Unretained(&disabled_system_component_ids_))); |
+#if defined(ENABLE_EXTENSIONS) |
extension_registry_observer_.Add( |
extensions::ExtensionRegistry::Get(profile_)); |
+#endif |
} |
DesktopNotificationService::~DesktopNotificationService() { |
@@ -290,11 +294,11 @@ void DesktopNotificationService::OnStringListPrefChanged( |
} |
} |
+#if defined(ENABLE_EXTENSIONS) |
void DesktopNotificationService::OnExtensionUninstalled( |
content::BrowserContext* browser_context, |
const extensions::Extension* extension, |
extensions::UninstallReason reason) { |
-#if defined(ENABLE_EXTENSIONS) |
NotifierId notifier_id(NotifierId::APPLICATION, extension->id()); |
if (IsNotifierEnabled(notifier_id)) |
return; |
@@ -304,8 +308,8 @@ void DesktopNotificationService::OnExtensionUninstalled( |
return; |
SetNotifierEnabled(notifier_id, true); |
-#endif |
} |
+#endif |
void DesktopNotificationService::OnNotificationPermissionRequested( |
const NotificationPermissionCallback& callback, bool allowed) { |