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

Side by Side Diff: src/plugin/AdblockPlusClient.h

Issue 5316782940225536: Issue 1557 - Update to the recent libadblockplus to reduce additional updates in the logic later. (Closed)
Patch Set: Created Nov. 21, 2014, 4:07 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 | « src/engine/Main.cpp ('k') | src/plugin/AdblockPlusClient.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 #ifndef _ADBLOCK_PLUS_CLIENT_H_ 1 #ifndef _ADBLOCK_PLUS_CLIENT_H_
2 #define _ADBLOCK_PLUS_CLIENT_H_ 2 #define _ADBLOCK_PLUS_CLIENT_H_
3 3
4 4
5 #include "PluginTypedef.h" 5 #include "PluginTypedef.h"
6 #include "PluginClientBase.h" 6 #include "PluginClientBase.h"
7 #include "../shared/Communication.h" 7 #include "../shared/Communication.h"
8 #include "../shared/CriticalSection.h" 8 #include "../shared/CriticalSection.h"
9 #include <AdblockPlus/FilterEngine.h>
9 10
10 11
11 class CPluginFilter; 12 class CPluginFilter;
12 13
13 struct SubscriptionDescription 14 struct SubscriptionDescription
14 { 15 {
15 std::wstring url; 16 std::wstring url;
16 std::wstring title; 17 std::wstring title;
17 std::wstring specialization; 18 std::wstring specialization;
18 bool listed; 19 bool listed;
(...skipping 23 matching lines...) Expand all
42 public: 43 public:
43 44
44 static CAdblockPlusClient* s_instance; 45 static CAdblockPlusClient* s_instance;
45 46
46 ~CAdblockPlusClient(); 47 ~CAdblockPlusClient();
47 48
48 static CAdblockPlusClient* GetInstance(); 49 static CAdblockPlusClient* GetInstance();
49 50
50 // Removes the url from the list of whitelisted urls if present 51 // Removes the url from the list of whitelisted urls if present
51 // Only called from ui thread 52 // Only called from ui thread
52 bool ShouldBlock(const std::wstring& src, int contentType, const std::wstring& domain, bool addDebug=false); 53 bool ShouldBlock(const std::wstring& src, AdblockPlus::FilterEngine::ContentTy pe contentType, const std::wstring& domain, bool addDebug=false);
53 54
54 bool IsElementHidden(const std::wstring& tag, IHTMLElement* pEl, const std::ws tring& domain, const std::wstring& indent, CPluginFilter* filter); 55 bool IsElementHidden(const std::wstring& tag, IHTMLElement* pEl, const std::ws tring& domain, const std::wstring& indent, CPluginFilter* filter);
55 bool IsWhitelistedUrl(const std::wstring& url); 56 bool IsWhitelistedUrl(const std::wstring& url);
56 bool IsElemhideWhitelistedOnDomain(const std::wstring& url); 57 bool IsElemhideWhitelistedOnDomain(const std::wstring& url);
57 58
58 int GetIEVersion(); 59 int GetIEVersion();
59 60
60 bool Matches(const std::wstring& url, const std::wstring& contentType, const s td::wstring& domain); 61 bool Matches(const std::wstring& url, AdblockPlus::FilterEngine::ContentType c ontentType, const std::wstring& domain);
61 std::vector<std::wstring> GetElementHidingSelectors(const std::wstring& domain ); 62 std::vector<std::wstring> GetElementHidingSelectors(const std::wstring& domain );
62 std::vector<SubscriptionDescription> FetchAvailableSubscriptions(); 63 std::vector<SubscriptionDescription> FetchAvailableSubscriptions();
63 std::vector<SubscriptionDescription> GetListedSubscriptions(); 64 std::vector<SubscriptionDescription> GetListedSubscriptions();
64 bool IsAcceptableAdsEnabled(); 65 bool IsAcceptableAdsEnabled();
65 void SetSubscription(const std::wstring& url); 66 void SetSubscription(const std::wstring& url);
66 void AddSubscription(const std::wstring& url); 67 void AddSubscription(const std::wstring& url);
67 void RemoveSubscription(const std::wstring& url); 68 void RemoveSubscription(const std::wstring& url);
68 void UpdateAllSubscriptions(); 69 void UpdateAllSubscriptions();
69 std::vector<std::wstring> GetExceptionDomains(); 70 std::vector<std::wstring> GetExceptionDomains();
70 void AddFilter(const std::wstring& text); 71 void AddFilter(const std::wstring& text);
71 void RemoveFilter(const std::wstring& text); 72 void RemoveFilter(const std::wstring& text);
72 void SetPref(const std::wstring& name, const std::wstring& value); 73 void SetPref(const std::wstring& name, const std::wstring& value);
73 void SetPref(const std::wstring& name, const int64_t& value); 74 void SetPref(const std::wstring& name, const int64_t& value);
74 void SetPref(const std::wstring& name, bool value); 75 void SetPref(const std::wstring& name, bool value);
75 std::wstring GetPref(const std::wstring& name, const std::wstring& defaultValu e = L""); 76 std::wstring GetPref(const std::wstring& name, const std::wstring& defaultValu e = L"");
76 std::wstring GetPref(const std::wstring& name, const wchar_t* defaultValue); 77 std::wstring GetPref(const std::wstring& name, const wchar_t* defaultValue);
77 bool GetPref(const std::wstring& name, bool defaultValue = false); 78 bool GetPref(const std::wstring& name, bool defaultValue = false);
78 int64_t GetPref(const std::wstring& name, int64_t defaultValue = 0); 79 int64_t GetPref(const std::wstring& name, int64_t defaultValue = 0);
79 void CheckForUpdates(HWND callbackWindow); 80 void CheckForUpdates(HWND callbackWindow);
80 std::wstring GetAppLocale(); 81 std::wstring GetAppLocale();
81 std::wstring GetDocumentationLink(); 82 std::wstring GetDocumentationLink();
82 bool TogglePluginEnabled(); 83 bool TogglePluginEnabled();
83 std::wstring GetHostFromUrl(const std::wstring& url); 84 std::wstring GetHostFromUrl(const std::wstring& url);
84 int CompareVersions(const std::wstring& v1, const std::wstring& v2); 85 int CompareVersions(const std::wstring& v1, const std::wstring& v2);
85 86
86 bool IsFirstRun(); 87 bool IsFirstRun();
87 }; 88 };
88 89
89 #endif // _ADBLOCK_PLUS_CLIENT_H_ 90 #endif // _ADBLOCK_PLUS_CLIENT_H_
OLDNEW
« no previous file with comments | « src/engine/Main.cpp ('k') | src/plugin/AdblockPlusClient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld