Left: | ||
Right: |
OLD | NEW |
---|---|
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 | 18 |
20 | 19 |
21 void CPluginTab::OnNavigate(const CString& url) | 20 void CPluginTab::OnNavigate(const CString& url) |
Felix Dahlke
2013/07/25 13:52:33
I don't think there's any point in overwriting thi
Oleksandr
2013/07/26 14:20:04
You're right. I'd still leave the CPuginTab class
| |
22 { | 21 { |
23 CPluginTabBase::OnNavigate(url); | 22 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 } | 23 } |
OLD | NEW |