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

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

Issue 11013110: Cleanup (Closed)
Left Patch Set: SetPref/GetPref type safety. Comments addressed. Created July 22, 2013, 12:42 a.m.
Right 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:
Right: Side by side diff | Download
« no previous file with change/comment | « src/plugin/DownloadSource.h ('k') | src/plugin/PluginChecksum.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
(no file at all)
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include "Plugin.h" 3 #include "Plugin.h"
4 #ifdef _WIN64 4 #ifdef _WIN64
5 #include "../../build/x64/AdblockPlus_i.c" 5 #include "../../build/x64/AdblockPlus_i.c"
6 #else 6 #else
7 #include "../../build/ia32/AdblockPlus_i.c" 7 #include "../../build/ia32/AdblockPlus_i.c"
8 #endif 8 #endif
9 9
10 #include "PluginClass.h" 10 #include "PluginClass.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 { 105 {
106 return _Module.UnregisterServer(TRUE); 106 return _Module.UnregisterServer(TRUE);
107 } 107 }
108 108
109 void InitPlugin(bool isInstall) 109 void InitPlugin(bool isInstall)
110 { 110 {
111 CPluginSystem* system = CPluginSystem::GetInstance(); 111 CPluginSystem* system = CPluginSystem::GetInstance();
112 112
113 CPluginSettings* settings = CPluginSettings::GetInstance(); 113 CPluginSettings* settings = CPluginSettings::GetInstance();
114 114
115 settings->SetMainProcessId();
116 settings->EraseTab();
117
118 settings->Remove(SETTING_PLUGIN_SELFTEST);
119 settings->SetValue(SETTING_PLUGIN_INFO_PANEL, isInstall ? 1 : 2);
120
121
122 settings->Write();
123
124 if (isInstall) 115 if (isInstall)
125 { 116 {
126 DEBUG_GENERAL( 117 DEBUG_GENERAL(
127 L"======================================================================== ========\nINSTALLER " + 118 L"======================================================================== ========\nINSTALLER " +
128 CString(IEPLUGIN_VERSION) + 119 CString(IEPLUGIN_VERSION) +
129 L"\n====================================================================== ==========") 120 L"\n====================================================================== ==========")
130 } 121 }
131 else 122 else
132 { 123 {
133 DEBUG_GENERAL( 124 DEBUG_GENERAL(
134 L"======================================================================== ========\nUPDATER " + 125 L"======================================================================== ========\nUPDATER " +
135 CString(IEPLUGIN_VERSION) + L" (UPDATED FROM " + settings->GetString(SETTI NG_PLUGIN_VERSION) + L")" 126 CString(IEPLUGIN_VERSION) +
136 L"\n====================================================================== ==========") 127 L"\n====================================================================== ==========")
137 } 128 }
138
139 // Create default filters
140 #ifdef SUPPORT_FILTER
141 // DEBUG_GENERAL(L"*** Generating default filters")
142 // CPluginFilter::CreateFilters();
143 #endif
144
145 // Force creation of default config file
146 #ifdef SUPPORT_CONFIG
147 DEBUG_GENERAL("*** Generating config file")
148 CPluginConfig* config = CPluginConfig::GetInstance();
149 config->Create(true);
150 #endif
151
152 HKEY hKey = NULL;
153 DWORD dwDisposition = 0;
154
155 DWORD dwResult = NULL;
156 129
157 // Post async plugin error 130 // Post async plugin error
158 CPluginError pluginError; 131 CPluginError pluginError;
159 while (CPluginClientBase::PopFirstPluginError(pluginError)) 132 while (CPluginClientBase::PopFirstPluginError(pluginError))
160 { 133 {
161 CPluginClientBase::LogPluginError(pluginError.GetErrorCode(), pluginError.Ge tErrorId(), pluginError.GetErrorSubid(), pluginError.GetErrorDescription(), true , pluginError.GetProcessId(), pluginError.GetThreadId()); 134 CPluginClientBase::LogPluginError(pluginError.GetErrorCode(), pluginError.Ge tErrorId(), pluginError.GetErrorSubid(), pluginError.GetErrorDescription(), true , pluginError.GetProcessId(), pluginError.GetThreadId());
162 } 135 }
163 } 136 }
164 137
165 // Called from installer 138 // Called from installer
166 EXTERN_C void STDAPICALLTYPE OnInstall(MSIHANDLE hInstall, MSIHANDLE tmp) 139 EXTERN_C void STDAPICALLTYPE OnInstall(MSIHANDLE hInstall, MSIHANDLE tmp)
167 { 140 {
168 InitPlugin(true); 141 InitPlugin(true);
169 } 142 }
170 143
171 // Called from updater 144 // Called from updater
172 EXTERN_C void STDAPICALLTYPE OnUpdate(void) 145 EXTERN_C void STDAPICALLTYPE OnUpdate(void)
173 { 146 {
174 InitPlugin(false); 147 InitPlugin(false);
175 } 148 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld