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

Unified Diff: chrome/browser/extensions/extension_gcm_app_handler.cc

Issue 299393002: Use ExtensionRegistryObserver instead of deprecated extension notification from c/b/extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 7 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/extensions/extension_gcm_app_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_gcm_app_handler.cc
diff --git a/chrome/browser/extensions/extension_gcm_app_handler.cc b/chrome/browser/extensions/extension_gcm_app_handler.cc
index 2e7d436dba0cc076468fa7ede54431d022f37702..7336fb6382c67194eaec962e2c1e70cbe808e1cc 100644
--- a/chrome/browser/extensions/extension_gcm_app_handler.cc
+++ b/chrome/browser/extensions/extension_gcm_app_handler.cc
@@ -12,8 +12,6 @@
#include "chrome/browser/services/gcm/gcm_profile_service.h"
#include "chrome/browser/services/gcm/gcm_profile_service_factory.h"
#include "components/gcm_driver/gcm_driver.h"
-#include "content/public/browser/notification_details.h"
-#include "content/public/browser/notification_source.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/extension.h"
@@ -48,10 +46,6 @@ ExtensionGCMAppHandler::ExtensionGCMAppHandler(content::BrowserContext* context)
extension_registry_observer_(this),
weak_factory_(this) {
extension_registry_observer_.Add(ExtensionRegistry::Get(profile_));
- registrar_.Add(this,
- chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
- content::Source<Profile>(profile_));
-
#if !defined(OS_ANDROID)
js_event_router_.reset(new extensions::GcmJsEventRouter(profile_));
#endif
@@ -111,12 +105,9 @@ void ExtensionGCMAppHandler::OnExtensionUnloaded(
GetGCMDriver()->RemoveAppHandler(extension->id());
}
-void ExtensionGCMAppHandler::Observe(
- int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- DCHECK_EQ(chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED, type);
- const Extension* extension = content::Details<Extension>(details).ptr();
+void ExtensionGCMAppHandler::OnExtensionUninstalled(
+ content::BrowserContext* browser_context,
+ const Extension* extension) {
if (IsGCMPermissionEnabled(extension)) {
GetGCMDriver()->Unregister(
extension->id(),
« no previous file with comments | « chrome/browser/extensions/extension_gcm_app_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698