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

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, reland Created 8 years, 5 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.h ('k') | chrome/common/extensions/extension_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1b613991fea7113efdb79c57c9d92f84f489d4a0..1e30283df5269e7e7b0474e3fc93b42f4f150aa4 100644
--- a/chrome/common/extensions/event_filtering_info.cc
+++ b/chrome/common/extensions/event_filtering_info.cc
@@ -31,4 +31,18 @@ std::string EventFilteringInfo::AsJSONString() const {
return result;
}
+scoped_ptr<base::Value> EventFilteringInfo::AsValue() const {
+ if (IsEmpty())
+ return scoped_ptr<base::Value>(base::Value::CreateNullValue());
+
+ scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue);
+ if (has_url_)
+ result->SetString("url", url_.spec());
+ return result.PassAs<base::Value>();
+}
+
+bool EventFilteringInfo::IsEmpty() const {
+ return !has_url_;
+}
+
} // namespace extensions
« no previous file with comments | « chrome/common/extensions/event_filtering_info.h ('k') | chrome/common/extensions/extension_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698