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

Unified Diff: chrome/common/extensions/event_filtering_info.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_filtering_info.cc
diff --git a/chrome/common/extensions/event_filtering_info.cc b/chrome/common/extensions/event_filtering_info.cc
index dcf78fc25da4b54cb3899de8664de6bfd0f397a3..1b613991fea7113efdb79c57c9d92f84f489d4a0 100644
--- a/chrome/common/extensions/event_filtering_info.cc
+++ b/chrome/common/extensions/event_filtering_info.cc
@@ -4,6 +4,9 @@
#include "chrome/common/extensions/event_filtering_info.h"
+#include "base/values.h"
+#include "base/json/json_writer.h"
+
namespace extensions {
EventFilteringInfo::EventFilteringInfo()
@@ -18,4 +21,14 @@ void EventFilteringInfo::SetURL(const GURL& url) {
has_url_ = true;
}
+std::string EventFilteringInfo::AsJSONString() const {
+ std::string result;
+ base::DictionaryValue value;
+ if (has_url_)
+ value.SetString("url", url_.spec());
+
+ base::JSONWriter::Write(&value, &result);
+ return result;
+}
+
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698