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

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

Issue 11427013: Appear fast for IE (Closed)
Patch Set: Comments addressed Created Aug. 7, 2013, 4:01 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 "PluginClass.h" 3 #include "PluginClass.h"
4 #include "PluginSettings.h" 4 #include "PluginSettings.h"
5 #include "PluginSystem.h" 5 #include "PluginSystem.h"
6 #ifdef SUPPORT_FILTER 6 #ifdef SUPPORT_FILTER
7 #include "PluginFilter.h" 7 #include "PluginFilter.h"
8 #endif 8 #endif
9 #include "PluginMimeFilterClient.h" 9 #include "PluginMimeFilterClient.h"
10 #include "PluginClient.h" 10 #include "PluginClient.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 m_webBrowser2 = unknownSite; 252 m_webBrowser2 = unknownSite;
253 } 253 }
254 s_criticalSectionBrowser.Unlock(); 254 s_criticalSectionBrowser.Unlock();
255 255
256 //register the mimefilter 256 //register the mimefilter
257 //and only mimefilter 257 //and only mimefilter
258 //on some few computers the mimefilter does not get properly registered when it is done on another thread 258 //on some few computers the mimefilter does not get properly registered when it is done on another thread
259 259
260 s_criticalSectionLocal.Lock(); 260 s_criticalSectionLocal.Lock();
261 { 261 {
262 if (settings->GetPluginEnabled()) 262 // Always register on startup, then check if we need to unregister in a se parate thread
263 { 263 s_mimeFilter = CPluginClientFactory::GetMimeFilterClientInstance();
264 s_mimeFilter = CPluginClientFactory::GetMimeFilterClientInstance();
265 }
266
267 s_asyncWebBrowser2 = unknownSite; 264 s_asyncWebBrowser2 = unknownSite;
268 s_instances.Add(this); 265 s_instances.Add(this);
269 } 266 }
270 s_criticalSectionLocal.Unlock(); 267 s_criticalSectionLocal.Unlock();
271 268
272 try 269 try
273 { 270 {
274 // Check if loaded as BHO 271 // Check if loaded as BHO
275 if (GetBrowser()) 272 if (GetBrowser())
276 { 273 {
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 722
726 // do nothing 723 // do nothing
727 break; 724 break;
728 } 725 }
729 726
730 return VARIANT_TRUE; 727 return VARIANT_TRUE;
731 } 728 }
732 729
733 bool CPluginClass::InitObject(bool bBHO) 730 bool CPluginClass::InitObject(bool bBHO)
734 { 731 {
732 CPluginSettings* settings = CPluginSettings::GetInstance();
733
734 if (!settings->GetPluginEnabled())
735 {
736 s_mimeFilter->Unregister();
737 }
738
735 // Load theme module 739 // Load theme module
736
737
738 s_criticalSectionLocal.Lock(); 740 s_criticalSectionLocal.Lock();
739 { 741 {
740 if (!s_hUxtheme) 742 if (!s_hUxtheme)
741 { 743 {
742 s_hUxtheme = ::GetModuleHandle(_T("uxtheme.dll")); 744 s_hUxtheme = ::GetModuleHandle(_T("uxtheme.dll"));
743 if (s_hUxtheme) 745 if (s_hUxtheme)
744 { 746 {
745 pfnClose = (CLOSETHEMEDATA)::GetProcAddress(s_hUxtheme, "CloseThemeData" ); 747 pfnClose = (CLOSETHEMEDATA)::GetProcAddress(s_hUxtheme, "CloseThemeData" );
746 if (!pfnClose) 748 if (!pfnClose)
747 { 749 {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 813
812 if (CPluginClient::GetInstance()->IsFirstRun()) 814 if (CPluginClient::GetInstance()->IsFirstRun())
813 { 815 {
814 CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)CPluginClass::FirstRunThrea d, NULL, NULL, NULL); 816 CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)CPluginClass::FirstRunThrea d, NULL, NULL, NULL);
815 if ((m_hPaneWnd == NULL) || (!IsStatusBarEnabled())) 817 if ((m_hPaneWnd == NULL) || (!IsStatusBarEnabled()))
816 { 818 {
817 ShowStatusBar(); 819 ShowStatusBar();
818 } 820 }
819 821
820 } 822 }
821
822 CPluginSettings* settings = CPluginSettings::GetInstance();
823 return true; 823 return true;
824 } 824 }
825 825
826 bool CPluginClass::CreateStatusBarPane() 826 bool CPluginClass::CreateStatusBarPane()
827 { 827 {
828 DEBUG_GENERAL(L"Getting client"); 828 DEBUG_GENERAL(L"Getting client");
829 829
830 CPluginClient* client = CPluginClient::GetInstance(); 830 CPluginClient* client = CPluginClient::GetInstance();
831 831
832 DEBUG_GENERAL(L"Getting ieversion"); 832 DEBUG_GENERAL(L"Getting ieversion");
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after
1909 } 1909 }
1910 } 1910 }
1911 } 1911 }
1912 1912
1913 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); 1913 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT);
1914 } 1914 }
1915 1915
1916 return hTabWnd; 1916 return hTabWnd;
1917 1917
1918 } 1918 }
OLDNEW

Powered by Google App Engine
This is Rietveld