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

Unified Diff: src/plugin/PluginFilter.cpp

Issue 6567422169448448: Issue 119 - Switch to injecting CSS for element hiding (Closed)
Patch Set: rename OnQuit Created Sept. 30, 2016, 3:25 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/plugin/PluginFilter.h ('k') | src/plugin/PluginTabBase.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginFilter.cpp
diff --git a/src/plugin/PluginFilter.cpp b/src/plugin/PluginFilter.cpp
index f4172affdcc0a135b16c1ac0abceab3ea0ca2023..02691ad447ab16792b348ad9b713c1f8cd773021 100644
--- a/src/plugin/PluginFilter.cpp
+++ b/src/plugin/PluginFilter.cpp
@@ -423,12 +423,6 @@ bool CFilterElementHide::IsMatchFilterElementHide(IHTMLElement* pEl) const
// CPluginFilter
// ============================================================================
-CPluginFilter::CPluginFilter(const CString& dataPath) : m_dataPath(dataPath)
-{
- ClearFilters();
-}
-
-
bool CPluginFilter::AddFilterElementHide(CString filterText)
{
DEBUG_FILTER("Input: " + filterText + " filterFile" + filterFile);
@@ -605,17 +599,16 @@ bool CPluginFilter::IsElementHidden(const std::wstring& tag, IHTMLElement* pEl,
return false;
}
-bool CPluginFilter::LoadHideFilters(std::vector<std::wstring> filters)
+CPluginFilter::CPluginFilter(const std::vector<std::wstring>& filters)
{
- ClearFilters();
- bool isRead = false;
+ m_hideFilters = filters;
CPluginClient* client = CPluginClient::GetInstance();
// Parse hide string
int pos = 0;
CriticalSection::Lock filterEngineLock(s_criticalSectionFilterMap);
{
- for (std::vector<std::wstring>::iterator it = filters.begin(); it < filters.end(); ++it)
+ for (auto it = filters.begin(); it < filters.end(); ++it)
{
CString filter((*it).c_str());
// If the line is not commented out
@@ -638,16 +631,4 @@ bool CPluginFilter::LoadHideFilters(std::vector<std::wstring> filters)
}
}
}
-
- return isRead;
-}
-
-void CPluginFilter::ClearFilters()
-{
- // Clear filter maps
- CriticalSection::Lock filterEngineLock(s_criticalSectionFilterMap);
- m_elementHideTags.clear();
- m_elementHideTagsId.clear();
- m_elementHideTagsClass.clear();
-}
-
+}
« no previous file with comments | « src/plugin/PluginFilter.h ('k') | src/plugin/PluginTabBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld