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

Unified Diff: src/plugin/AdblockPlusClient.cpp

Issue 5338025085108224: Support Acceptable Ads (Closed)
Patch Set: Missing negation fix Created July 18, 2014, 7:39 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 | « src/plugin/AdblockPlusClient.h ('k') | src/plugin/PluginClass.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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::IsAcceptableAdsEnabled()
+{
+ 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++)
+ {
+ 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);
« no previous file with comments | « src/plugin/AdblockPlusClient.h ('k') | src/plugin/PluginClass.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld