OLD | NEW |
1 #ifndef _SIMPLE_ADBLOCK_CLIENT_H_ | 1 #ifndef _SIMPLE_ADBLOCK_CLIENT_H_ |
2 #define _SIMPLE_ADBLOCK_CLIENT_H_ | 2 #define _SIMPLE_ADBLOCK_CLIENT_H_ |
3 | 3 |
4 | 4 |
5 #include "PluginTypedef.h" | 5 #include "PluginTypedef.h" |
6 #include "PluginClientBase.h" | 6 #include "PluginClientBase.h" |
7 #include "AdblockPlus.h" | 7 #include "AdblockPlus.h" |
8 | 8 |
9 | 9 |
10 using namespace AdblockPlus; | 10 using namespace AdblockPlus; |
11 | 11 |
12 class CPluginFilter; | 12 class CPluginFilter; |
13 | 13 |
14 class CAdblockPlusClient : public CPluginClientBase | 14 class CAdblockPlusClient : public CPluginClientBase |
15 { | 15 { |
16 | 16 |
17 private: | 17 private: |
18 | 18 |
19 std::auto_ptr<CPluginFilter> m_filter; | 19 std::auto_ptr<CPluginFilter> m_filter; |
20 std::auto_ptr<AdblockPlus::FilterEngine> filterEngine; | 20 std::auto_ptr<AdblockPlus::FilterEngine> filterEngine; |
| 21 HWND filterEngineRequestWindow; |
| 22 HWND filterEngineResponseWindow; |
| 23 std::wstring filterEngineResponseWindowName; |
21 | 24 |
22 CComAutoCriticalSection m_criticalSectionFilter; | 25 CComAutoCriticalSection m_criticalSectionFilter; |
23 CComAutoCriticalSection m_criticalSectionCache; | 26 CComAutoCriticalSection m_criticalSectionCache; |
24 | 27 |
25 std::map<CString,bool> m_cacheBlockedSources; | 28 std::map<CString,bool> m_cacheBlockedSources; |
26 | 29 |
27 | 30 |
28 // Private constructor used by the singleton pattern | 31 // Private constructor used by the singleton pattern |
29 CAdblockPlusClient(); | 32 CAdblockPlusClient(); |
30 | 33 |
31 public: | 34 public: |
32 | 35 |
33 static CAdblockPlusClient* s_instance; | 36 static CAdblockPlusClient* s_instance; |
34 | 37 |
35 ~CAdblockPlusClient(); | 38 ~CAdblockPlusClient(); |
36 | 39 |
37 static CAdblockPlusClient* GetInstance(); | 40 static CAdblockPlusClient* GetInstance(); |
38 | 41 |
39 AdblockPlus::FilterEngine* GetFilterEngine(); | 42 AdblockPlus::FilterEngine* GetFilterEngine(); |
40 | 43 |
41 // Removes the url from the list of whitelisted urls if present | 44 // Removes the url from the list of whitelisted urls if present |
42 // Only called from ui thread | 45 // Only called from ui thread |
43 bool ShouldBlock(CString src, int contentType, const CString& domain, bool add
Debug=false); | 46 bool ShouldBlock(CString src, int contentType, const CString& domain, bool add
Debug=false); |
44 | 47 |
45 bool IsElementHidden(const CString& tag, IHTMLElement* pEl, const CString& dom
ain, const CString& indent, CPluginFilter* filter); | 48 bool IsElementHidden(const CString& tag, IHTMLElement* pEl, const CString& dom
ain, const CString& indent, CPluginFilter* filter); |
46 bool IsUrlWhiteListed(const CString& url); | 49 bool IsUrlWhiteListed(const CString& url); |
47 | 50 |
48 int GetIEVersion(); | 51 int GetIEVersion(); |
49 | 52 |
| 53 bool Matches(const std::string& url, const std::string& contentType, const std
::string& domain); |
50 }; | 54 }; |
51 | 55 |
52 #endif // _SIMPLE_ADBLOCK_CLIENT_H_ | 56 #endif // _SIMPLE_ADBLOCK_CLIENT_H_ |
OLD | NEW |