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

Side by Side Diff: AdBlocker/SimpleAdblockDomTraverser.cpp

Issue 8949229: Removal of all user tracking and shareware parts (Closed)
Patch Set: Created Dec. 6, 2012, 4:38 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
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include "PluginClient.h" 3 #include "PluginClient.h"
4 #include "PluginFilter.h" 4 #include "PluginFilter.h"
5 #include "PluginSettings.h" 5 #include "PluginSettings.h"
6 6
7 #include "SimpleAdblockDomTraverser.h" 7 #include "SimpleAdblockDomTraverser.h"
8 8
9 9
10 CPluginDomTraverser::CPluginDomTraverser(CPluginTab* tab) : CPluginDomTraverserB ase(tab) 10 CPluginDomTraverser::CPluginDomTraverser(CPluginTab* tab) : CPluginDomTraverserB ase(tab)
(...skipping 11 matching lines...) Expand all
22 { 22 {
23 HideElement(pEl, "iframe", url, true, indent); 23 HideElement(pEl, "iframe", url, true, indent);
24 } 24 }
25 25
26 return !isBlocked; 26 return !isBlocked;
27 } 27 }
28 28
29 29
30 bool CPluginDomTraverser::OnElement(IHTMLElement* pEl, const CString& tag, CPlug inDomTraverserCache* cache, bool isDebug, CString& indent) 30 bool CPluginDomTraverser::OnElement(IHTMLElement* pEl, const CString& tag, CPlug inDomTraverserCache* cache, bool isDebug, CString& indent)
31 { 31 {
32 //is plugin registered
33 CPluginSettings* settings = CPluginSettings::GetInstance();
34 if (!settings->GetBool(SETTING_PLUGIN_REGISTRATION, false))
35 {
36 //is the limit exceeded?
37 if ((settings->GetValue(SETTING_PLUGIN_ADBLOCKCOUNT, 0) >= setti ngs->GetValue(SETTING_PLUGIN_ADBLOCKLIMIT, 0)) &&
38 (settings->GetValue(SETTING_PLUGIN_ADBLOCKLIMIT, 0) > 0) )
39 {
40 return true;
41 }
42 }
43
44 if (cache->m_isHidden) 32 if (cache->m_isHidden)
45 { 33 {
46 return false; 34 return false;
47 } 35 }
Wladimir Palant 2012/12/10 11:49:13 Note for the future - indentation in this file (an
48 36
49 // Check if element is hidden 37 // Check if element is hidden
50 CPluginClient* client = CPluginClient::GetInstance(); 38 CPluginClient* client = CPluginClient::GetInstance();
51 39
52 cache->m_isHidden = client->IsElementHidden(tag, pEl, m_domain, indent); 40 cache->m_isHidden = client->IsElementHidden(tag, pEl, m_domain, indent);
53 if (cache->m_isHidden) 41 if (cache->m_isHidden)
54 { 42 {
55 HideElement(pEl, tag, "", false, indent); 43 HideElement(pEl, tag, "", false, indent);
56 return false; 44 return false;
57 } 45 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 139
152 #ifdef ENABLE_DEBUG_RESULT 140 #ifdef ENABLE_DEBUG_RESULT
153 if (isDebug) 141 if (isDebug)
154 { 142 {
155 CPluginDebug::DebugResultHiding(type, url, "-", "-"); 143 CPluginDebug::DebugResultHiding(type, url, "-", "-");
156 } 144 }
157 #endif // ENABLE_DEBUG_RESULT 145 #endif // ENABLE_DEBUG_RESULT
158 } 146 }
159 } 147 }
160 } 148 }
OLDNEW

Powered by Google App Engine
This is Rietveld