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: Created April 14, 2014, 7:01 a.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
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);

Powered by Google App Engine
This is Rietveld