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

Side by Side Diff: include/AdblockPlus/FilterEngine.h

Issue 10862008: Automatically add default filter subscription when necessary. (Closed)
Patch Set: Created May 27, 2013, 2:12 p.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/AppInfo.h ('k') | include/AdblockPlus/JsEngine.h » ('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 <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 Subscription(JsValuePtr value); 61 Subscription(JsValuePtr value);
62 }; 62 };
63 63
64 typedef std::tr1::shared_ptr<Filter> FilterPtr; 64 typedef std::tr1::shared_ptr<Filter> FilterPtr;
65 typedef std::tr1::shared_ptr<Subscription> SubscriptionPtr; 65 typedef std::tr1::shared_ptr<Subscription> SubscriptionPtr;
66 66
67 class FilterEngine 67 class FilterEngine
68 { 68 {
69 public: 69 public:
70 explicit FilterEngine(JsEnginePtr jsEngine); 70 explicit FilterEngine(JsEnginePtr jsEngine);
71 bool IsFirstRun() const;
71 FilterPtr GetFilter(const std::string& text); 72 FilterPtr GetFilter(const std::string& text);
72 SubscriptionPtr GetSubscription(const std::string& url); 73 SubscriptionPtr GetSubscription(const std::string& url);
73 std::vector<FilterPtr> GetListedFilters() const; 74 std::vector<FilterPtr> GetListedFilters() const;
74 std::vector<SubscriptionPtr> GetListedSubscriptions() const; 75 std::vector<SubscriptionPtr> GetListedSubscriptions() const;
75 std::vector<SubscriptionPtr> FetchAvailableSubscriptions() const; 76 std::vector<SubscriptionPtr> FetchAvailableSubscriptions() const;
76 FilterPtr Matches(const std::string& url, 77 FilterPtr Matches(const std::string& url,
77 const std::string& contentType, 78 const std::string& contentType,
78 const std::string& documentUrl); 79 const std::string& documentUrl);
79 std::vector<std::string> GetElementHidingSelectors(const std::string& domain ) const; 80 std::vector<std::string> GetElementHidingSelectors(const std::string& domain ) const;
80 81
81 private: 82 private:
82 JsEnginePtr jsEngine; 83 JsEnginePtr jsEngine;
83 bool initialized; 84 bool initialized;
85 bool firstRun;
84 86
85 void InitDone(); 87 void InitDone(JsValueList& params);
86 }; 88 };
87 } 89 }
88 90
89 #endif 91 #endif
OLDNEW
« no previous file with comments | « include/AdblockPlus/AppInfo.h ('k') | include/AdblockPlus/JsEngine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld