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

Side by Side Diff: src/FilterEngine.cpp

Issue 29424648: Issue 5123 - add Subscription::IsDisabled (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created April 28, 2017, 9:44 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/AdblockPlus/FilterEngine.h ('k') | test/FilterEngine.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 static_cast<JsValue&>(*this) = std::move(src); 127 static_cast<JsValue&>(*this) = std::move(src);
128 return *this; 128 return *this;
129 } 129 }
130 130
131 bool Subscription::IsListed() const 131 bool Subscription::IsListed() const
132 { 132 {
133 JsValue func = jsEngine->Evaluate("API.isListedSubscription"); 133 JsValue func = jsEngine->Evaluate("API.isListedSubscription");
134 return func.Call(*this).AsBool(); 134 return func.Call(*this).AsBool();
135 } 135 }
136 136
137 bool Subscription::IsDisabled() const
138 {
139 return GetProperty("disabled").AsBool();
140 }
141
142 void Subscription::SetDisabled(bool value)
143 {
144 return SetProperty("disabled", value);
145 }
146
137 void Subscription::AddToList() 147 void Subscription::AddToList()
138 { 148 {
139 JsValue func = jsEngine->Evaluate("API.addSubscriptionToList"); 149 JsValue func = jsEngine->Evaluate("API.addSubscriptionToList");
140 func.Call(*this); 150 func.Call(*this);
141 } 151 }
142 152
143 void Subscription::RemoveFromList() 153 void Subscription::RemoveFromList()
144 { 154 {
145 JsValue func = jsEngine->Evaluate("API.removeSubscriptionFromList"); 155 JsValue func = jsEngine->Evaluate("API.removeSubscriptionFromList");
146 func.Call(*this); 156 func.Call(*this);
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 FilterPtr filter = GetWhitelistingFilter(currentUrl, contentTypeMask, parent Url); 609 FilterPtr filter = GetWhitelistingFilter(currentUrl, contentTypeMask, parent Url);
600 if (filter) 610 if (filter)
601 { 611 {
602 return filter; 612 return filter;
603 } 613 }
604 currentUrl = parentUrl; 614 currentUrl = parentUrl;
605 } 615 }
606 while (urlIterator != documentUrls.end()); 616 while (urlIterator != documentUrls.end());
607 return FilterPtr(); 617 return FilterPtr();
608 } 618 }
OLDNEW
« no previous file with comments | « include/AdblockPlus/FilterEngine.h ('k') | test/FilterEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld