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

Unified Diff: chrome/common/extensions/event_matcher.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 | « chrome/common/extensions/event_filtering_info.cc ('k') | chrome/common/extensions/event_matcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/event_matcher.h
diff --git a/chrome/common/extensions/event_matcher.h b/chrome/common/extensions/event_matcher.h
index 7f9196281319193c2664354363bd608ce14565a1..318777dfcbff1e9e7f191c448ea5e86ae43fc011 100644
--- a/chrome/common/extensions/event_matcher.h
+++ b/chrome/common/extensions/event_matcher.h
@@ -19,28 +19,29 @@ class EventFilteringInfo;
// MatchNonURLCriteria() - URL matching is handled by EventFilter.
class EventMatcher {
public:
- EventMatcher();
+ explicit EventMatcher(scoped_ptr<base::DictionaryValue> filter);
~EventMatcher();
// Returns true if |event_info| satisfies this matcher's criteria, not taking
// into consideration any URL criteria.
bool MatchNonURLCriteria(const EventFilteringInfo& event_info) const;
- void set_url_filters(scoped_ptr<base::ListValue> url_filters) {
- url_filters_ = url_filters.Pass();
- }
+ int GetURLFilterCount() const;
+ bool GetURLFilter(int i, base::DictionaryValue** url_filter_out);
- // Returns NULL if no url_filters have been specified.
- base::ListValue* url_filters() const {
- return url_filters_.get();
- }
+ int HasURLFilters() const;
- bool has_url_filters() const {
- return url_filters_.get() && !url_filters_->empty();
+ base::DictionaryValue* value() const {
+ return filter_.get();
}
private:
- scoped_ptr<base::ListValue> url_filters_;
+ // Contains a dictionary that corresponds to a single event filter, eg:
+ //
+ // {url: [{hostSuffix: 'google.com'}]}
+ //
+ // The valid filter keys are event-specific.
+ scoped_ptr<base::DictionaryValue> filter_;
DISALLOW_COPY_AND_ASSIGN(EventMatcher);
};
« no previous file with comments | « chrome/common/extensions/event_filtering_info.cc ('k') | chrome/common/extensions/event_matcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698