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 |