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: 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
« no previous file with comments | « no previous file | lib/api.js » ('j') | lib/api.js » ('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 f1c779b367c5efb176890ac96764d582aec5db34..9ecc5f53c1f071e26566e8765479e500675fbf2a 100644
--- a/include/AdblockPlus/FilterEngine.h
+++ b/include/AdblockPlus/FilterEngine.h
@@ -119,6 +119,12 @@ namespace AdblockPlus
*/
bool IsUpdating();
+ /**
+ * Indicates whether the subscription is acceptable ads subscription.
+ * @return `true` if this subscription is acceptable ads subscription.
+ */
+ bool IsAA();
hub 2017/03/17 20:04:15 Shouldn't this be a const method?
sergei 2017/03/17 22:10:06 I do agree that it should be const because for the
hub 2017/04/05 13:35:02 As it is right now, IsUpdating() above is const, s
sergei 2017/04/05 14:43:29 fixed.
+
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') | lib/api.js » ('J')

Powered by Google App Engine
This is Rietveld