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

Delta Between Two Patch Sets: src/plugin/PluginTabBase.cpp

Issue 4784041706389504: Issue 1183 - Fix Acceptable Ads hiding (Closed)
Left Patch Set: Created Aug. 8, 2014, 3:51 p.m.
Right Patch Set: More addressing comments Created Aug. 8, 2014, 4:54 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/plugin/AdblockPlusClient.cpp ('k') | src/shared/Communication.h » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include "PluginClient.h" 3 #include "PluginClient.h"
4 #include "PluginSettings.h" 4 #include "PluginSettings.h"
5 #ifdef SUPPORT_CONFIG 5 #ifdef SUPPORT_CONFIG
6 #include "PluginConfig.h" 6 #include "PluginConfig.h"
7 #endif 7 #endif
8 #include "PluginTab.h" 8 #include "PluginTab.h"
9 #include "PluginDomTraverser.h" 9 #include "PluginDomTraverser.h"
10 #include "PluginClass.h" 10 #include "PluginClass.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 DEBUG_GENERAL("Invoke"); 176 DEBUG_GENERAL("Invoke");
177 if (FAILED(hr)) 177 if (FAILED(hr))
178 { 178 {
179 DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_CREATE_SETTINGS_JAVASCRIPT, PLUGIN_ERROR_CR EATE_SETTINGS_JAVASCRIPT_INVOKE, "CPluginTabBase::InjectABP - Failed to create S ettings in JavaScript"); 179 DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_CREATE_SETTINGS_JAVASCRIPT, PLUGIN_ERROR_CR EATE_SETTINGS_JAVASCRIPT_INVOKE, "CPluginTabBase::InjectABP - Failed to create S ettings in JavaScript");
180 } 180 }
181 } 181 }
182 182
183 void CPluginTabBase::OnDownloadComplete(IWebBrowser2* browser) 183 void CPluginTabBase::OnDownloadComplete(IWebBrowser2* browser)
184 { 184 {
185 #ifdef SUPPORT_DOM_TRAVERSER 185 #ifdef SUPPORT_DOM_TRAVERSER
186 if (!CPluginClient::GetInstance()->IsWhitelistedUrl(std::wstring(GetDocumentUr l()))) 186 CPluginClient* client = CPluginClient::GetInstance();
187 { 187 std::wstring url = std::wstring(GetDocumentUrl());
188 if (CPluginClient::GetInstance()->HidingEnabledOnDomain(std::wstring(GetDocu mentUrl()))) 188 if (!client->IsWhitelistedUrl(url) && !client->IsElemhideWhitelistedOnDomain(u rl))
Felix Dahlke 2014/08/08 16:11:35 Oh noes, the arrow pattern! :D Can you merge this
189 { 189 {
190 m_traverser->TraverseDocument(browser, GetDocumentDomain(), GetDocumentUrl ()); 190 m_traverser->TraverseDocument(browser, GetDocumentDomain(), GetDocumentUrl() );
191 }
192 } 191 }
193 #endif // SUPPORT_DOM_TRAVERSER 192 #endif // SUPPORT_DOM_TRAVERSER
194 193
195 InjectABP(browser); 194 InjectABP(browser);
196 } 195 }
197 196
198 void CPluginTabBase::OnDocumentComplete(IWebBrowser2* browser, const CString& ur l, bool isDocumentBrowser) 197 void CPluginTabBase::OnDocumentComplete(IWebBrowser2* browser, const CString& ur l, bool isDocumentBrowser)
199 { 198 {
200 CString documentUrl = GetDocumentUrl(); 199 CString documentUrl = GetDocumentUrl();
201 200
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 CPluginClient::LogPluginError(pluginError.GetErrorCode(), pluginError. GetErrorId(), pluginError.GetErrorSubid(), pluginError.GetErrorDescription(), tr ue, pluginError.GetProcessId(), pluginError.GetThreadId()); 388 CPluginClient::LogPluginError(pluginError.GetErrorCode(), pluginError. GetErrorId(), pluginError.GetErrorSubid(), pluginError.GetErrorDescription(), tr ue, pluginError.GetProcessId(), pluginError.GetThreadId());
390 } 389 }
391 390
392 // Non-hanging sleep 391 // Non-hanging sleep
393 Sleep(50); 392 Sleep(50);
394 } 393 }
395 394
396 tabLoopIteration++; 395 tabLoopIteration++;
397 } 396 }
398 } 397 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld