| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| 1 #ifndef _PLUGIN_FILTER_H_ | 1 #ifndef _PLUGIN_FILTER_H_ |
| 2 #define _PLUGIN_FILTER_H_ | 2 #define _PLUGIN_FILTER_H_ |
| 3 | 3 |
| 4 | 4 |
| 5 #include "PluginTypedef.h" | 5 #include "PluginTypedef.h" |
| 6 #include <memory> | 6 #include <memory> |
| 7 | 7 |
| 8 enum CFilterElementHideAttrPos | 8 enum CFilterElementHideAttrPos |
| 9 { | 9 { |
| 10 POS_NONE = 0, STARTING, ENDING, ANYWHERE, EXACT | 10 POS_NONE = 0, STARTING, ENDING, ANYWHERE, EXACT |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 // Tag -> Filter | 143 // Tag -> Filter |
| 144 typedef std::multimap<CString, CFilterElementHide> TFilterElementHideTags; | 144 typedef std::multimap<CString, CFilterElementHide> TFilterElementHideTags; |
| 145 | 145 |
| 146 | 146 |
| 147 TFilterElementHideTagsNamed m_elementHideTagsId; | 147 TFilterElementHideTagsNamed m_elementHideTagsId; |
| 148 TFilterElementHideTagsNamed m_elementHideTagsClass; | 148 TFilterElementHideTagsNamed m_elementHideTagsClass; |
| 149 TFilterElementHideTags m_elementHideTags; | 149 TFilterElementHideTags m_elementHideTags; |
| 150 | 150 |
| 151 TFilterMap m_filterMap[2][2]; | 151 TFilterMap m_filterMap[2][2]; |
| 152 TFilterMapDefault m_filterMapDefault[2]; | 152 TFilterMapDefault m_filterMapDefault[2]; |
| 153 std::vector<std::wstring> m_hideFilters; | |
| 153 | 154 |
| 154 void ClearFilters(); | 155 void ClearFilters(); |
| 155 | 156 |
| 156 public: | 157 public: |
| 157 | 158 |
| 158 CPluginFilter(const CString& dataPath = ""); | 159 CPluginFilter(const CString& dataPath = ""); |
| 159 | 160 |
| 160 bool LoadHideFilters(std::vector<std::wstring> filters); | 161 bool LoadHideFilters(const std::vector<std::wstring>& filters); |
| 161 | 162 |
| 162 bool AddFilterElementHide(CString filter); | 163 bool AddFilterElementHide(CString filter); |
| 163 | 164 |
| 164 | 165 |
| 165 bool IsElementHidden(const std::wstring& tag, IHTMLElement* pEl, const std::ws tring& domain, const std::wstring& indent) const; | 166 bool IsElementHidden(const std::wstring& tag, IHTMLElement* pEl, const std::ws tring& domain, const std::wstring& indent) const; |
| 166 | 167 |
| 167 | 168 |
| 168 bool ShouldBlock(const std::wstring& src, int contentType, const std::wstring& domain, bool addDebug=false) const; | 169 bool ShouldBlock(const std::wstring& src, int contentType, const std::wstring& domain, bool addDebug=false) const; |
| 169 | 170 |
| 170 HANDLE hideFiltersLoadedEvent; | 171 HANDLE hideFiltersLoadedEvent; |
| 172 const std::vector<std::wstring>& getHideFilters() const; | |
|
Oleksandr
2015/02/04 20:59:57
GetHideFilters() to be consistent?
sergei
2015/04/13 08:06:58
fixed
| |
| 171 }; | 173 }; |
| 172 | 174 |
| 173 | 175 |
| 174 #endif // _PLUGIN_FILTER_H_ | 176 #endif // _PLUGIN_FILTER_H_ |
| OLD | NEW |