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: fix typo Created April 5, 2017, 4:53 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
« no previous file with comments | « 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 42b7b0b5a2e8a3960c46451b575d3b115c330115..22c4bba4670da81544f7a764119291e6b0715d70 100644
--- a/src/FilterEngine.cpp
+++ b/src/FilterEngine.cpp
@@ -114,6 +114,11 @@ bool Subscription::IsUpdating() const
return func->Call(*this).AsBool();
}
+bool Subscription::IsAA() const
+{
+ return jsEngine->Evaluate("API.isAASubscription")->Call(*this).AsBool();
+}
+
bool Subscription::operator==(const Subscription& subscription) const
{
return GetProperty("url")->AsString() == subscription.GetProperty("url")->AsString();
@@ -313,6 +318,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");
« no previous file with comments | « lib/compat.js ('k') | test/FilterEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld