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

Unified Diff: include/AdblockPlus/FilterEngine.h

Issue 29366747: Issue 4657 - Add Acceptable Ads API (Closed)
Patch Set: rebase and address comment Created April 5, 2017, 2:38 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 | « no previous file | lib/api.js » ('j') | test/FilterEngine.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/FilterEngine.h
diff --git a/include/AdblockPlus/FilterEngine.h b/include/AdblockPlus/FilterEngine.h
index 3d1df9f5fa9a17ab60178455a6c92889edfed15f..f445c62395cf94dc5d4a9097baa0409c35af1838 100644
--- a/include/AdblockPlus/FilterEngine.h
+++ b/include/AdblockPlus/FilterEngine.h
@@ -119,6 +119,12 @@ namespace AdblockPlus
*/
bool IsUpdating() const;
+ /**
+ * Indicates whether the subscription is acceptable ads subscription.
+ * @return `true` if this subscription is acceptable ads subscription.
+ */
+ bool IsAA() const;
+
bool operator==(const Subscription& subscription) const;
/**
@@ -307,6 +313,31 @@ namespace AdblockPlus
std::vector<SubscriptionPtr> FetchAvailableSubscriptions() const;
/**
+ * Ensures that Acceptable Ads subscription is enabled or disabled.
+ * @param enabled
+ * - if the value is `true`
+ * - ensure that the filter set includes an enabled AA subscription,
+ * adding it if needed and enabling it if disabled.
+ * - if the value is `false`
+ * - if an AA subscription is present, disable it.
+ * - if absent, do nothing.
+ */
+ void SetAAEnabled(bool enabled);
+
+ /**
+ * Checks whether Acceptable Ads subscription is enabled.
+ * @return `true` if acceptable ads subscription is present and enabled.
+ */
+ bool IsAAEnabled() const;
+
+ /**
+ * Retrieves the URL of Acceptable Ads subscription, what makes the URL
+ * available even if subscription is not add yet.
+ * @return Returns URL of Acceptable Ads.
+ */
+ std::string GetAAUrl() const;
+
+ /**
* Invokes the listener set via SetNotificationAvailableCallback() with the
* next notification to be shown.
* @param url URL to match notifications to (optional).
« no previous file with comments | « no previous file | lib/api.js » ('j') | test/FilterEngine.cpp » ('J')

Powered by Google App Engine
This is Rietveld