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

Side by Side Diff: src/plugin/AdblockPlusTab.cpp

Issue 11013110: Cleanup (Closed)
Patch Set: More beautification and addressing comments Created July 29, 2013, 12:13 p.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 | « src/plugin/AdblockPlusTab.h ('k') | src/plugin/Config.h » ('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 "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 }
OLDNEW
« no previous file with comments | « src/plugin/AdblockPlusTab.h ('k') | src/plugin/Config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld