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

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: respond to comments 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
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..db67e9cda75b1953a864210c47df54ee013045a7 100644
--- a/chrome/common/extensions/event_matcher.h
+++ b/chrome/common/extensions/event_matcher.h
@@ -19,28 +19,26 @@ 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 {
+ return GetURLFilterCount() != 0;
battre 2012/06/18 12:29:17 move to .cc file?
koz (OOO until 15th September) 2012/06/19 00:07:57 Done.
}
- 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_;
+ scoped_ptr<base::DictionaryValue> filter_;
battre 2012/06/18 12:29:17 can we add a comment about the content of filter_?
koz (OOO until 15th September) 2012/06/19 00:07:57 Done.
DISALLOW_COPY_AND_ASSIGN(EventMatcher);
};

Powered by Google App Engine
This is Rietveld 408576698