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

Unified Diff: chrome/common/extensions/event_matcher.cc

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.cc
diff --git a/chrome/common/extensions/event_matcher.cc b/chrome/common/extensions/event_matcher.cc
index 1f9e47481c9baac0e2c046fbdd3bd06df53ed6fa..36af3d54c8c6d25b5bb9ba16375fd046a58952b1 100644
--- a/chrome/common/extensions/event_matcher.cc
+++ b/chrome/common/extensions/event_matcher.cc
@@ -5,9 +5,14 @@
#include "chrome/common/extensions/event_matcher.h"
#include "chrome/common/extensions/event_filtering_info.h"
+namespace {
+const char kUrlFiltersKey[] = "url";
+}
+
namespace extensions {
-EventMatcher::EventMatcher() {
+EventMatcher::EventMatcher(scoped_ptr<base::DictionaryValue> filter)
+ : filter_(filter.Pass()) {
}
EventMatcher::~EventMatcher() {
@@ -19,4 +24,19 @@ bool EventMatcher::MatchNonURLCriteria(
return true;
}
+int EventMatcher::GetURLFilterCount() const {
+ base::ListValue* url_filters;
battre 2012/06/18 12:29:17 nit: initialize to NULL?
koz (OOO until 15th September) 2012/06/19 00:07:57 Done.
+ if (filter_->GetList(kUrlFiltersKey, &url_filters))
+ return url_filters->GetSize();
+ return 0;
+}
+
+bool EventMatcher::GetURLFilter(int i, base::DictionaryValue** url_filter_out) {
+ base::ListValue* url_filters;
battre 2012/06/18 12:29:17 nit: initialize to NULL?
koz (OOO until 15th September) 2012/06/19 00:07:57 Done.
+ if (filter_->GetList(kUrlFiltersKey, &url_filters)) {
+ return url_filters->GetDictionary(i, url_filter_out);
+ }
+ return false;
+}
+
} // namespace extensions
« chrome/common/extensions/event_matcher.h ('K') | « chrome/common/extensions/event_matcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698