LEFT | RIGHT |
(no file at all) | |
1 #include "PluginStdAfx.h" | 1 #include "PluginStdAfx.h" |
2 | 2 |
3 #include "PluginSettings.h" | 3 #include "PluginSettings.h" |
4 #include "PluginSystem.h" | 4 #include "PluginSystem.h" |
5 #include "PluginClass.h" | 5 #include "PluginClass.h" |
6 #include "PluginConfiguration.h" | |
7 #include "PluginClientFactory.h" | 6 #include "PluginClientFactory.h" |
8 | 7 |
9 #include "AdblockPlusTab.h" | 8 #include "AdblockPlusTab.h" |
10 | 9 |
11 | 10 |
12 CPluginTab::CPluginTab(CPluginClass* plugin) : CPluginTabBase(plugin) | 11 CPluginTab::CPluginTab(CPluginClass* plugin) : CPluginTabBase(plugin) |
13 { | 12 { |
14 } | 13 } |
15 | 14 |
16 CPluginTab::~CPluginTab() | 15 CPluginTab::~CPluginTab() |
17 { | 16 { |
18 } | 17 } |
19 | |
20 | |
21 void CPluginTab::OnNavigate(const CString& url) | |
22 { | |
23 CPluginTabBase::OnNavigate(url); | |
24 | |
25 int r = url.Find(L".simple-adblock.com"); | |
26 if ((r > 0) && (r < 15)) | |
27 { | |
28 if (url.Find(L"?update") > 0) | |
29 { | |
30 CPluginConfiguration pluginConfig; | |
31 pluginConfig.Download(); | |
32 DWORD id; | |
33 HANDLE handle = ::CreateThread(NULL, 0, CPluginClass::MainThreadProc, (LPV
OID)this, NULL, &id); | |
34 CPluginSettings* settings = CPluginSettings::GetInstance(); | |
35 | |
36 //Also register a mime filter if it's not registered yet | |
37 if (CPluginClass::s_mimeFilter == NULL) | |
38 { | |
39 CPluginClass::s_mimeFilter = CPluginClientFactory::GetMimeFilterClientIn
stance(); | |
40 } | |
41 | |
42 settings->Write(); | |
43 this->OnUpdateConfig(); | |
44 this->OnUpdateSettings(true); | |
45 } | |
46 } | |
47 } | |
LEFT | RIGHT |