Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/FilterEngine.cpp

Issue 29366747: Issue 4657 - Add Acceptable Ads API (Closed)
Patch Set: address comments and rebase Created March 17, 2017, 3:49 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« lib/api.js ('K') | « lib/compat.js ('k') | test/FilterEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/FilterEngine.cpp
diff --git a/src/FilterEngine.cpp b/src/FilterEngine.cpp
index 6b0c1ee1f90d796c9054ad4b5e7c416a060f2e49..4cd2e79cede08db40555119b958191ab0de502c3 100644
--- a/src/FilterEngine.cpp
+++ b/src/FilterEngine.cpp
@@ -131,6 +131,11 @@ bool Subscription::IsUpdating()
return result->AsBool();
}
+bool Subscription::IsAA()
+{
+ return jsEngine->Evaluate("API.isAASubscription")->Call(*shared_from_this())->AsBool();
+}
+
bool Subscription::operator==(const Subscription& subscription) const
{
return GetProperty("url")->AsString() == subscription.GetProperty("url")->AsString();
@@ -335,6 +340,21 @@ std::vector<SubscriptionPtr> FilterEngine::FetchAvailableSubscriptions() const
return result;
}
+void FilterEngine::SetAAEnabled(bool enabled)
+{
+ jsEngine->Evaluate("API.setAASubscriptionEnabled")->Call(*jsEngine->NewValue(enabled));
+}
+
+bool FilterEngine::IsAAEnabled() const
+{
+ return jsEngine->Evaluate("API.isAASubscriptionEnabled()")->AsBool();
+}
+
+std::string FilterEngine::GetAAUrl() const
+{
+ return GetPref("subscriptions_exceptionsurl")->AsString();
+}
+
void FilterEngine::ShowNextNotification(const std::string& url)
{
JsValuePtr func = jsEngine->Evaluate("API.showNextNotification");
« lib/api.js ('K') | « lib/compat.js ('k') | test/FilterEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld