Index: src/plugin/AdblockPlusClient.cpp |
=================================================================== |
--- a/src/plugin/AdblockPlusClient.cpp |
+++ b/src/plugin/AdblockPlusClient.cpp |
@@ -343,6 +343,21 @@ |
return ReadSubscriptions(response); |
} |
+// Returns true if Acceptable Ads are enabled, false otherwise. |
+bool CAdblockPlusClient::AcceptableAdsStatus() |
Felix Dahlke
2014/06/30 17:24:04
How about IsAcceptableAdsEnabled()? That'd make th
|
+{ |
+ std::vector<SubscriptionDescription> subscriptions = GetListedSubscriptions(); |
+ std::wstring aaUrl = GetPref(L"subscriptions_exceptionsurl", L""); |
+ for (std::vector<SubscriptionDescription>::iterator subscription = subscriptions.begin(); subscription < subscriptions.end(); subscription ++) |
Felix Dahlke
2014/06/30 17:24:04
!= for iterators, not <
Also no whitespace before
|
+ { |
+ if (subscription->url == aaUrl) |
+ { |
+ return true; |
+ } |
+ } |
+ return false; |
+} |
+ |
void CAdblockPlusClient::SetSubscription(const std::wstring& url) |
{ |
Communication::OutputBuffer request; |
@@ -350,6 +365,21 @@ |
CallEngine(request); |
} |
+void CAdblockPlusClient::AddSubscription(const std::wstring& url) |
+{ |
+ Communication::OutputBuffer request; |
+ request << Communication::PROC_ADD_SUBSCRIPTION << ToUtf8String(url); |
+ CallEngine(request); |
+} |
+ |
+void CAdblockPlusClient::RemoveSubscription(const std::wstring& url) |
+{ |
+ Communication::OutputBuffer request; |
+ request << Communication::PROC_REMOVE_SUBSCRIPTION << ToUtf8String(url); |
+ CallEngine(request); |
+} |
+ |
+ |
void CAdblockPlusClient::UpdateAllSubscriptions() |
{ |
CallEngine(Communication::PROC_UPDATE_ALL_SUBSCRIPTIONS); |