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

Delta Between Two Patch Sets: src/FilterEngine.cpp

Issue 9987009: Interface for the libadblockplus API (Closed)
Left Patch Set: Use new API in the shell Created March 27, 2013, 4:58 a.m.
Right Patch Set: Reduce redundant redundancy Created March 27, 2013, 6:45 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « shell/src/SubscriptionsCommand.cpp ('k') | test/FilterEngineStubs.cpp » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #include <AdblockPlus.h> 1 #include <AdblockPlus.h>
2 2
3 using namespace AdblockPlus; 3 using namespace AdblockPlus;
4 4
5 Subscription::Subscription(const std::string& url, const std::string& title) 5 Subscription::Subscription(const std::string& url, const std::string& title)
6 : url(url), title(title) 6 : url(url), title(title)
7 { 7 {
8 } 8 }
9 9
10 FilterEngine::FilterEngine(JsEngine& jsEngine) : jsEngine(jsEngine) 10 FilterEngine::FilterEngine(JsEngine& jsEngine) : jsEngine(jsEngine)
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 } 48 }
49 49
50 std::vector<Subscription> FilterEngine::FetchAvailableSubscriptions() 50 std::vector<Subscription> FilterEngine::FetchAvailableSubscriptions()
51 { 51 {
52 std::vector<Subscription> availableSubscriptions; 52 std::vector<Subscription> availableSubscriptions;
53 availableSubscriptions.push_back(Subscription("https://easylist-downloads.adbl ockplus.org/easylist.txt", "EasyList")); 53 availableSubscriptions.push_back(Subscription("https://easylist-downloads.adbl ockplus.org/easylist.txt", "EasyList"));
54 availableSubscriptions.push_back(Subscription("https://easylist-downloads.adbl ockplus.org/easylistgermany+easylist.txt", "EasyList Germany+EasyList")); 54 availableSubscriptions.push_back(Subscription("https://easylist-downloads.adbl ockplus.org/easylistgermany+easylist.txt", "EasyList Germany+EasyList"));
55 return availableSubscriptions; 55 return availableSubscriptions;
56 } 56 }
57 57
58 bool FilterEngine::MatchesFilters(const std::string& url, 58 bool FilterEngine::Matches(const std::string& url,
59 const std::string& contentType) const 59 const std::string& contentType) const
60 { 60 {
61 return subscriptions.size() && url.length() % 2; 61 return subscriptions.size() && url.length() % 2;
62 } 62 }
63 63
64 std::vector<std::string> FilterEngine::GetElementHidingRules() const 64 std::vector<std::string> FilterEngine::GetElementHidingRules() const
65 { 65 {
66 std::vector<std::string> hidingRules; 66 std::vector<std::string> hidingRules;
67 hidingRules.push_back("###ad"); 67 hidingRules.push_back("###ad");
68 hidingRules.push_back("##.ad"); 68 hidingRules.push_back("##.ad");
69 return hidingRules; 69 return hidingRules;
70 } 70 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld