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

Unified Diff: extensions/browser/event_router.cc

Issue 2893693002: Remove NOTIFICATION_EXTENSION_ENABLED. (Closed)
Patch Set: address comments Created 3 years, 6 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 | « extensions/browser/event_router.h ('k') | extensions/browser/events/lazy_event_dispatch_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/event_router.cc
diff --git a/extensions/browser/event_router.cc b/extensions/browser/event_router.cc
index 37ee6698dcec84c6648c5fc47430dd194b97cf57..96faf6c3dcec769af83c64625c57a58cea219e45 100644
--- a/extensions/browser/event_router.cc
+++ b/extensions/browser/event_router.cc
@@ -15,7 +15,6 @@
#include "base/metrics/histogram_macros.h"
#include "base/stl_util.h"
#include "base/values.h"
-#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_process_host.h"
#include "extensions/browser/api_activity_monitor.h"
#include "extensions/browser/event_router_factory.h"
@@ -25,7 +24,6 @@
#include "extensions/browser/extension_system.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/lazy_background_task_queue.h"
-#include "extensions/browser/notification_types.h"
#include "extensions/browser/process_manager.h"
#include "extensions/browser/process_map.h"
#include "extensions/common/constants.h"
@@ -48,8 +46,6 @@ namespace extensions {
namespace {
-void DoNothing(ExtensionHost* host) {}
-
// A dictionary of event names to lists of filters that this extension has
// registered from its lazy background page.
const char kFilteredEvents[] = "filtered_events";
@@ -142,10 +138,8 @@ EventRouter::EventRouter(BrowserContext* browser_context,
: browser_context_(browser_context),
extension_prefs_(extension_prefs),
extension_registry_observer_(this),
- listeners_(this) {
- registrar_.Add(this,
- extensions::NOTIFICATION_EXTENSION_ENABLED,
- content::Source<BrowserContext>(browser_context_));
+ listeners_(this),
+ lazy_event_dispatch_util_(browser_context_) {
extension_registry_observer_.Add(ExtensionRegistry::Get(browser_context_));
}
@@ -747,21 +741,6 @@ void EventRouter::AddFilterToEvent(const std::string& event_name,
filter_list->Append(filter->CreateDeepCopy());
}
-void EventRouter::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_ENABLED, type);
- // If the extension has a lazy background page, make sure it gets loaded
- // to register the events the extension is interested in.
- const Extension* extension = content::Details<const Extension>(details).ptr();
- if (BackgroundInfo::HasLazyBackgroundPage(extension)) {
- LazyBackgroundTaskQueue* queue =
- LazyBackgroundTaskQueue::Get(browser_context_);
- queue->AddPendingTask(browser_context_, extension->id(),
- base::Bind(&DoNothing));
- }
-}
-
void EventRouter::OnExtensionLoaded(content::BrowserContext* browser_context,
const Extension* extension) {
// Add all registered lazy listeners to our cache.
« no previous file with comments | « extensions/browser/event_router.h ('k') | extensions/browser/events/lazy_event_dispatch_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698