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

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

Issue 10514013: Filtered events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, fix cross_incognito_args bug 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..0f8957c50866880642f55859454b8924e556aaef 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,21 @@ 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;
+}
+
+scoped_ptr<base::Value> EventFilteringInfo::AsValue() const {
+ scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue);
+ if (has_url_)
+ result->SetString("url", url_.spec());
+ return scoped_ptr<base::Value>(result.release());
+}
+
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698