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

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

Issue 10897028: Create a shared dictionary class for plugin and engine (Closed)
Patch Set: Created June 7, 2013, 12:42 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
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include "Plugin.h" 3 #include "Plugin.h"
4 #include "../../build/AdblockPlus_i.c" 4 #include "../../build/AdblockPlus_i.c"
5 5
6 #include "PluginClass.h" 6 #include "PluginClass.h"
7 #include "PluginClient.h" 7 #include "PluginClient.h"
8 #include "PluginSystem.h" 8 #include "PluginSystem.h"
9 #include "PluginSettings.h" 9 #include "PluginSettings.h"
10 #include "PluginDictionary.h"
11 #include "PluginMimeFilterClient.h" 10 #include "PluginMimeFilterClient.h"
12 #include "Msiquery.h" 11 #include "Msiquery.h"
13 12
14 #ifdef SUPPORT_FILTER 13 #ifdef SUPPORT_FILTER
15 #include "PluginFilter.h" 14 #include "PluginFilter.h"
16 #endif 15 #endif
17 #ifdef SUPPORT_CONFIG 16 #ifdef SUPPORT_CONFIG
18 #include "PluginConfig.h" 17 #include "PluginConfig.h"
19 #endif 18 #endif
20 19
20 #include "../shared/Dictionary.h"
21 21
22 CComModule _Module; 22 CComModule _Module;
23 23
24 BEGIN_OBJECT_MAP(ObjectMap) 24 BEGIN_OBJECT_MAP(ObjectMap)
25 OBJECT_ENTRY(CLSID_PluginClass, CPluginClass) 25 OBJECT_ENTRY(CLSID_PluginClass, CPluginClass)
26 END_OBJECT_MAP() 26 END_OBJECT_MAP()
27 27
28 //Dll Entry Point 28 //Dll Entry Point
29 BOOL WINAPI DllMain(HINSTANCE hInstDll, DWORD fdwReason, LPVOID reserved) 29 BOOL WINAPI DllMain(HINSTANCE hInstDll, DWORD fdwReason, LPVOID reserved)
30 { 30 {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 CString(IEPLUGIN_VERSION) + L" (UPDATED FROM " + settings->GetString(SETTI NG_PLUGIN_VERSION) + L")" 131 CString(IEPLUGIN_VERSION) + L" (UPDATED FROM " + settings->GetString(SETTI NG_PLUGIN_VERSION) + L")"
132 L"\n====================================================================== ==========") 132 L"\n====================================================================== ==========")
133 } 133 }
134 134
135 // Create default filters 135 // Create default filters
136 #ifdef SUPPORT_FILTER 136 #ifdef SUPPORT_FILTER
137 // DEBUG_GENERAL(L"*** Generating default filters") 137 // DEBUG_GENERAL(L"*** Generating default filters")
138 // CPluginFilter::CreateFilters(); 138 // CPluginFilter::CreateFilters();
139 #endif 139 #endif
140 140
141 // Force creation of default dictionary 141 std::wstring locale((LPCWSTR)CPluginSystem::GetInstance()->GetBrowserLanguage( ));
142 CPluginDictionary* dictionary = CPluginDictionary::GetInstance(true); 142 Dictionary::Create(locale);
Wladimir Palant 2013/06/10 08:45:06 I realized that this isn't the right place to init
143 dictionary->Create(true);
144 143
145 // Force creation of default config file 144 // Force creation of default config file
146 #ifdef SUPPORT_CONFIG 145 #ifdef SUPPORT_CONFIG
147 DEBUG_GENERAL("*** Generating config file") 146 DEBUG_GENERAL("*** Generating config file")
148 CPluginConfig* config = CPluginConfig::GetInstance(); 147 CPluginConfig* config = CPluginConfig::GetInstance();
149 config->Create(true); 148 config->Create(true);
150 #endif 149 #endif
151 150
152 HKEY hKey = NULL; 151 HKEY hKey = NULL;
153 DWORD dwDisposition = 0; 152 DWORD dwDisposition = 0;
(...skipping 12 matching lines...) Expand all
166 EXTERN_C void STDAPICALLTYPE OnInstall(MSIHANDLE hInstall, MSIHANDLE tmp) 165 EXTERN_C void STDAPICALLTYPE OnInstall(MSIHANDLE hInstall, MSIHANDLE tmp)
167 { 166 {
168 InitPlugin(true); 167 InitPlugin(true);
169 } 168 }
170 169
171 // Called from updater 170 // Called from updater
172 EXTERN_C void STDAPICALLTYPE OnUpdate(void) 171 EXTERN_C void STDAPICALLTYPE OnUpdate(void)
173 { 172 {
174 InitPlugin(false); 173 InitPlugin(false);
175 } 174 }
OLDNEW

Powered by Google App Engine
This is Rietveld