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

Unified Diff: chrome/browser/extensions/extension_event_router.h

Issue 10025007: Convert tabs, windows, and extension APIs to feature system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: blah Created 8 years, 8 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 | « no previous file | chrome/browser/extensions/extension_event_router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_event_router.h
diff --git a/chrome/browser/extensions/extension_event_router.h b/chrome/browser/extensions/extension_event_router.h
index 2b52cc812bae9e6b4526fa6f8307338eb1525cf7..a08d816fdb14cdd8d90f90fa8476f5a93507bb90 100644
--- a/chrome/browser/extensions/extension_event_router.h
+++ b/chrome/browser/extensions/extension_event_router.h
@@ -15,6 +15,7 @@
#include "base/memory/ref_counted.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "chrome/common/extensions/feature.h"
#include "ipc/ipc_message.h"
class GURL;
@@ -23,6 +24,8 @@ class ExtensionHost;
class ExtensionDevToolsManager;
class Profile;
+using extensions::Feature;
+
namespace content {
class RenderProcessHost;
}
@@ -54,8 +57,9 @@ class ExtensionEventRouter : public content::NotificationObserver {
// collapsing. Also, a single extension can have 2 processes if it is a split
// mode extension.
void AddEventListener(const std::string& event_name,
+ const std::string& extension_id,
content::RenderProcessHost* process,
- const std::string& extension_id);
+ Feature::Context context);
void RemoveEventListener(const std::string& event_name,
content::RenderProcessHost* process,
const std::string& extension_id);
@@ -65,6 +69,12 @@ class ExtensionEventRouter : public content::NotificationObserver {
// remembered even after the process goes away. We use this list to decide
// which extension pages to load when dispatching an event.
void AddLazyEventListener(const std::string& event_name,
+ const std::string& extension_id,
+ content::RenderProcessHost* process,
+ Feature::Context context);
+ // Use this overload when subscribing extensions to events from C++, or when
+ // access checking the calling process and context is not required.
+ void AddLazyEventListener(const std::string& event_name,
const std::string& extension_id);
void RemoveLazyEventListener(const std::string& event_name,
const std::string& extension_id);
@@ -131,6 +141,12 @@ class ExtensionEventRouter : public content::NotificationObserver {
// event.
struct ListenerProcess;
+ // Helper that returns whether the event is accessible to the calling context.
+ bool IsEventAvailable(const std::string& event_name,
+ const std::string& extension_id,
+ content::RenderProcessHost* render_process,
+ Feature::Context context_type) const;
+
// A map between an event name and a set of extensions that are listening
// to that event.
typedef std::map<std::string, std::set<ListenerProcess> > ListenerMap;
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698