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

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

Issue 582673002: Fixed Build breaks while notification is enabled and extension is disabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 3 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/browser/notifications/desktop_notification_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 eb6d72f6b7a30377eba03195accebb1370a8bd0e..8f489b4c3d0f08dc4d11ef8107b7326e9ba6f08e 100644
--- a/chrome/browser/notifications/desktop_notification_service.cc
+++ b/chrome/browser/notifications/desktop_notification_service.cc
@@ -104,7 +104,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_);
@@ -127,8 +129,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() {
@@ -296,11 +300,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;
@@ -310,8 +314,8 @@ void DesktopNotificationService::OnExtensionUninstalled(
return;
SetNotifierEnabled(notifier_id, true);
-#endif
}
+#endif
void DesktopNotificationService::OnNotificationPermissionRequested(
const NotificationPermissionCallback& callback, bool allowed) {
« no previous file with comments | « chrome/browser/notifications/desktop_notification_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698