| OLD | NEW |
| 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 #include "PluginDictionary.h" | 5 #include "PluginDictionary.h" |
| 6 #ifdef SUPPORT_CONFIG | 6 #ifdef SUPPORT_CONFIG |
| 7 #include "PluginConfig.h" | 7 #include "PluginConfig.h" |
| 8 #endif | 8 #endif |
| 9 #include "PluginTab.h" | 9 #include "PluginTab.h" |
| 10 #include "PluginDomTraverser.h" | 10 #include "PluginDomTraverser.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #ifdef SUPPORT_WHITELIST | 22 #ifdef SUPPORT_WHITELIST |
| 23 int CPluginTabBase::s_whitelistVersion = 0; | 23 int CPluginTabBase::s_whitelistVersion = 0; |
| 24 #endif | 24 #endif |
| 25 #ifdef SUPPORT_CONFIG | 25 #ifdef SUPPORT_CONFIG |
| 26 int CPluginTabBase::s_configVersion = 0; | 26 int CPluginTabBase::s_configVersion = 0; |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 | 29 |
| 30 CPluginTabBase::CPluginTabBase(CPluginClass* plugin) : m_plugin(plugin), m_isAct
ivated(false) | 30 CPluginTabBase::CPluginTabBase(CPluginClass* plugin) : m_plugin(plugin), m_isAct
ivated(false) |
| 31 { | 31 { |
| 32 m_filter = std::auto_ptr<CPluginFilter>(new CPluginFilter()); |
| 33 |
| 32 CPluginClient* client = CPluginClient::GetInstance(); | 34 CPluginClient* client = CPluginClient::GetInstance(); |
| 33 if (client->GetIEVersion() < 10) | 35 if (client->GetIEVersion() < 10) |
| 34 { | 36 { |
| 35 m_isActivated = true; | 37 m_isActivated = true; |
| 36 } | 38 } |
| 37 | 39 |
| 38 DWORD id; | 40 DWORD id; |
| 39 m_hThread = ::CreateThread(NULL, 0, ThreadProc, (LPVOID)this, CREATE_SUSPENDED
, &id); | 41 m_hThread = ::CreateThread(NULL, 0, ThreadProc, (LPVOID)this, CREATE_SUSPENDED
, &id); |
| 40 if (m_hThread) | 42 if (m_hThread) |
| 41 { | 43 { |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 127 |
| 126 void CPluginTabBase::OnNavigate(const CString& url) | 128 void CPluginTabBase::OnNavigate(const CString& url) |
| 127 { | 129 { |
| 128 SetDocumentUrl(url); | 130 SetDocumentUrl(url); |
| 129 | 131 |
| 130 | 132 |
| 131 #ifdef SUPPORT_FRAME_CACHING | 133 #ifdef SUPPORT_FRAME_CACHING |
| 132 ClearFrameCache(GetDocumentDomain()); | 134 ClearFrameCache(GetDocumentDomain()); |
| 133 #endif | 135 #endif |
| 134 | 136 |
| 137 std::string domainString = CT2A(GetDocumentDomain()); |
| 138 m_filter->LoadHideFilters(CPluginClient::GetInstance()->GetFilterEngine()->Get
ElementHidingSelectors(domainString)); |
| 139 |
| 135 #ifdef SUPPORT_DOM_TRAVERSER | 140 #ifdef SUPPORT_DOM_TRAVERSER |
| 136 m_traverser->ClearCache(); | 141 m_traverser->ClearCache(); |
| 137 #endif | 142 #endif |
| 138 } | 143 } |
| 139 | 144 |
| 140 void CPluginTabBase::OnDownloadComplete(IWebBrowser2* browser) | 145 void CPluginTabBase::OnDownloadComplete(IWebBrowser2* browser) |
| 141 { | 146 { |
| 142 #ifdef SUPPORT_DOM_TRAVERSER | 147 #ifdef SUPPORT_DOM_TRAVERSER |
| 143 m_traverser->TraverseDocument(browser, GetDocumentDomain(), GetDocumentUrl()); | 148 m_traverser->TraverseDocument(browser, GetDocumentDomain(), GetDocumentUrl()); |
| 144 #endif // SUPPORT_DOM_TRAVERSER | 149 #endif // SUPPORT_DOM_TRAVERSER |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 client->ClearWhiteListCache(); | 410 client->ClearWhiteListCache(); |
| 406 isChanged = true; | 411 isChanged = true; |
| 407 } | 412 } |
| 408 #endif // SUPPORT_WHITELIST | 413 #endif // SUPPORT_WHITELIST |
| 409 | 414 |
| 410 #ifdef SUPPORT_FILTER | 415 #ifdef SUPPORT_FILTER |
| 411 int newFilterVersion = settings->GetTabVersion(SETTING_TAB_FILTER_VERSIO
N); | 416 int newFilterVersion = settings->GetTabVersion(SETTING_TAB_FILTER_VERSIO
N); |
| 412 if (s_filterVersion != newFilterVersion) | 417 if (s_filterVersion != newFilterVersion) |
| 413 { | 418 { |
| 414 s_filterVersion = newFilterVersion; | 419 s_filterVersion = newFilterVersion; |
| 415 client->LoadFilters(); | |
| 416 isChanged = true; | 420 isChanged = true; |
| 417 } | 421 } |
| 418 #endif | 422 #endif |
| 419 if (isChanged) | 423 if (isChanged) |
| 420 { | 424 { |
| 421 tab->m_plugin->UpdateStatusBar(); | 425 tab->m_plugin->UpdateStatusBar(); |
| 422 } | 426 } |
| 423 | 427 |
| 424 tab->m_isActivated = false; | 428 tab->m_isActivated = false; |
| 425 } | 429 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 440 | 444 |
| 441 // Non-hanging sleep | 445 // Non-hanging sleep |
| 442 Sleep(50); | 446 Sleep(50); |
| 443 } | 447 } |
| 444 | 448 |
| 445 tabLoopIteration++; | 449 tabLoopIteration++; |
| 446 } | 450 } |
| 447 | 451 |
| 448 return 0; | 452 return 0; |
| 449 } | 453 } |
| OLD | NEW |