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

Unified Diff: chrome/common/extensions/event_filter.h

Issue 10534125: Extend EventFilter to handle the case where EventMatchers from event X get (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 8 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 | « no previous file | chrome/common/extensions/event_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/event_filter.h
diff --git a/chrome/common/extensions/event_filter.h b/chrome/common/extensions/event_filter.h
index 26acb4420adf2e433fe49dff38e77c15a9538dd8..6c42c43fa25ec810f0c9f555921348b1de670c69 100644
--- a/chrome/common/extensions/event_filter.h
+++ b/chrome/common/extensions/event_filter.h
@@ -29,6 +29,14 @@ class EventFilter {
// the id of the matcher, or -1 if there was an error.
MatcherID AddEventMatcher(const std::string& event_name,
scoped_ptr<EventMatcher> matcher);
+
+ // Retrieve the EventMatcher with the given id.
+ EventMatcher* GetEventMatcher(MatcherID id);
+
+ // Retrieve the name of the event that the EventMatcher specified by |id| is
+ // referring to.
+ const std::string& GetEventName(MatcherID id);
+
// Removes an event matcher, returning the name of the event that it was for.
std::string RemoveEventMatcher(MatcherID id);
@@ -64,8 +72,8 @@ class EventFilter {
// and clean them up anyway.
void DontRemoveConditionSetsInDestructor();
- const EventMatcher& event_matcher() const {
- return *event_matcher_;
+ EventMatcher* event_matcher() {
+ return event_matcher_.get();
}
private:
@@ -83,10 +91,10 @@ class EventFilter {
// Maps from event name to the map of matchers that are registered for it.
typedef std::map<std::string, EventMatcherMap> EventMatcherMultiMap;
- // Adds the list of filters to the URL matcher, having matches for those URLs
- // map to |id|.
+ // Adds the list of URL filters in |matcher| to the URL matcher, having
+ // matches for those URLs map to |id|.
bool CreateConditionSets(MatcherID id,
- base::ListValue* url_filters,
+ EventMatcher* matcher,
URLMatcherConditionSet::Vector* condition_sets);
bool AddDictionaryAsConditionSet(
« no previous file with comments | « no previous file | chrome/common/extensions/event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698