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

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

Issue 409643002: Remove DEPRECATED extension notification from desktop_notification_service.* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 e0c1bb7edec2fc100606a96d7e55f455a94af89a..fb615168c58b5039183ea0d103ec3a8158e6c1cd 100644
--- a/chrome/browser/notifications/desktop_notification_service.cc
+++ b/chrome/browser/notifications/desktop_notification_service.cc
@@ -53,6 +53,7 @@
#include "chrome/browser/extensions/api/notifications/notifications_api.h"
#include "chrome/browser/extensions/extension_service.h"
#include "extensions/browser/event_router.h"
+#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/extension_util.h"
#include "extensions/browser/info_map.h"
@@ -387,7 +388,8 @@ DesktopNotificationService::DesktopNotificationService(
Profile* profile,
NotificationUIManager* ui_manager)
: profile_(profile),
- ui_manager_(ui_manager) {
+ ui_manager_(ui_manager),
+ extension_registry_observer_(this) {
OnStringListPrefChanged(
prefs::kMessageCenterDisabledExtensionIds, &disabled_extension_ids_);
OnStringListPrefChanged(
@@ -409,9 +411,8 @@ DesktopNotificationService::DesktopNotificationService(
base::Unretained(this),
base::Unretained(prefs::kMessageCenterDisabledSystemComponentIds),
base::Unretained(&disabled_system_component_ids_)));
- registrar_.Add(this,
- chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
- content::Source<Profile>(profile_));
+ extension_registry_observer_.Add(
+ extensions::ExtensionRegistry::Get(profile_));
}
DesktopNotificationService::~DesktopNotificationService() {
@@ -690,15 +691,11 @@ void DesktopNotificationService::OnStringListPrefChanged(
}
}
-void DesktopNotificationService::Observe(
- int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
+void DesktopNotificationService::OnExtensionUninstalled(
+ content::BrowserContext* browser_context,
+ const extensions::Extension* extension,
+ extensions::UninstallReason reason) {
#if defined(ENABLE_EXTENSIONS)
- DCHECK_EQ(chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED, type);
-
- extensions::Extension* extension =
- content::Details<extensions::Extension>(details).ptr();
NotifierId notifier_id(NotifierId::APPLICATION, extension->id());
if (IsNotifierEnabled(notifier_id))
return;
« 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