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

Side by Side Diff: AdBlocker/SimpleAdblockDomTraverser.cpp

Issue 8978054: Removal of shareware parts (Closed)
Patch Set: Created Dec. 5, 2012, 7:59 a.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 | « AdBlocker/SimpleAdblockClient.cpp ('k') | AdBlocker/SimpleAdblockTab.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 #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 }
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)
(...skipping 97 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
« no previous file with comments | « AdBlocker/SimpleAdblockClient.cpp ('k') | AdBlocker/SimpleAdblockTab.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld