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: 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/AdblockPlusDomTraverser.h ('k') | src/plugin/PluginClass.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
{
« no previous file with comments | « src/plugin/AdblockPlusDomTraverser.h ('k') | src/plugin/PluginClass.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld