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

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

Issue 29334386: Issue #2230 - Refactor filter life cycle and use
Patch Set: rebase only Created May 17, 2016, 7:45 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/plugin/PluginDomTraverserBase.h ('k') | src/plugin/PluginFilter.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 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 CFilter(const CFilter&); 112 CFilter(const CFilter&);
113 CFilter(); 113 CFilter();
114 }; 114 };
115 115
116 // ============================================================================ 116 // ============================================================================
117 // CPluginFilter 117 // CPluginFilter
118 // ============================================================================ 118 // ============================================================================
119 119
120 class CPluginFilter 120 class CPluginFilter
121 { 121 {
122
123 private:
124
125 std::wstring m_dataPath;
126
127 // (Tag,Name) -> Filter 122 // (Tag,Name) -> Filter
128 typedef std::multimap<std::pair<std::wstring, std::wstring>, CFilterElementHid e> TFilterElementHideTagsNamed; 123 typedef std::multimap<std::pair<std::wstring, std::wstring>, CFilterElementHid e> TFilterElementHideTagsNamed;
129
130 // Tag -> Filter 124 // Tag -> Filter
131 typedef std::multimap<std::wstring, CFilterElementHide> TFilterElementHideTags ; 125 typedef std::multimap<std::wstring, CFilterElementHide> TFilterElementHideTags ;
132
133
134 TFilterElementHideTagsNamed m_elementHideTagsId; 126 TFilterElementHideTagsNamed m_elementHideTagsId;
135 TFilterElementHideTagsNamed m_elementHideTagsClass; 127 TFilterElementHideTagsNamed m_elementHideTagsClass;
136 TFilterElementHideTags m_elementHideTags; 128 TFilterElementHideTags m_elementHideTags;
137
138 void ClearFilters(); 129 void ClearFilters();
139 130
140 public: 131 public:
141 CPluginFilter(const std::wstring& dataPath = L""); 132 CPluginFilter();
142 bool LoadHideFilters(std::vector<std::wstring> filters); 133 bool LoadHideFilters(std::vector<std::wstring> filters);
143 bool AddFilterElementHide(std::wstring filter); 134 bool AddFilterElementHide(std::wstring filter);
144 bool IsElementHidden(const std::wstring& tag, IHTMLElement* pEl, const std::ws tring& domain, const std::wstring& indent) const; 135 bool IsElementHidden(const std::wstring& tag, IHTMLElement* pEl, const std::ws tring& domain, const std::wstring& indent) const;
145 HANDLE hideFiltersLoadedEvent; 136 HANDLE hideFiltersLoadedEvent;
146 }; 137 };
147 138
148 139
149 #endif // _PLUGIN_FILTER_H_ 140 #endif // _PLUGIN_FILTER_H_
OLDNEW
« no previous file with comments | « src/plugin/PluginDomTraverserBase.h ('k') | src/plugin/PluginFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld