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

Unified Diff: src/plugin/AdblockPlusDomTraverser.cpp

Issue 6567422169448448: Issue 119 - Switch to injecting CSS for element hiding (Closed)
Patch Set: rebase, improve memory handling (OnQuit) and improve code organizing Created April 27, 2016, 1:10 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
Index: src/plugin/AdblockPlusDomTraverser.cpp
diff --git a/src/plugin/AdblockPlusDomTraverser.cpp b/src/plugin/AdblockPlusDomTraverser.cpp
index 24fea82fc92d95ecacd757854815b03c66e3fb91..9cbadd86b91dd743ffb9225d81e9d6dbeffe385b 100644
--- a/src/plugin/AdblockPlusDomTraverser.cpp
+++ b/src/plugin/AdblockPlusDomTraverser.cpp
@@ -23,7 +23,7 @@
#include "..\shared\Utils.h"
-CPluginDomTraverser::CPluginDomTraverser(CPluginTab* tab) : CPluginDomTraverserBase(tab)
+CPluginDomTraverser::CPluginDomTraverser(const PluginFilterPtr& pluginFilter) : CPluginDomTraverserBase(pluginFilter)
{
}
@@ -51,10 +51,7 @@ bool CPluginDomTraverser::OnElement(IHTMLElement* pEl, const std::wstring& tag,
return false;
}
- // Check if element is hidden
- CPluginClient* client = CPluginClient::GetInstance();
-
- cache->m_isHidden = client->IsElementHidden(tag, pEl, m_domain, indent, &(m_tab->m_filter));
+ cache->m_isHidden = m_pluginFilter->IsElementHidden(tag, pEl, m_domain, indent);
if (cache->m_isHidden)
{
HideElement(pEl, tag, L"", false, indent);
@@ -71,7 +68,7 @@ bool CPluginDomTraverser::OnElement(IHTMLElement* pEl, const std::wstring& tag,
if (!src.empty())
{
// If src should be blocked, set style display:none on image
- cache->m_isHidden = client->ShouldBlock(src,
+ cache->m_isHidden = CPluginClient::GetInstance()->ShouldBlock(src,
AdblockPlus::FilterEngine::ContentType::CONTENT_TYPE_IMAGE, m_documentUrl);
if (cache->m_isHidden)
{

Powered by Google App Engine
This is Rietveld