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: Created Aug. 7, 2013, 5:44 a.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 | « no previous file | src/plugin/PluginDomTraverserBase.h » ('j') | src/plugin/PluginDomTraverserBase.h » ('J')
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 "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 // We always register on startup and then check if we should do that in a seperate thread
Felix Dahlke 2013/08/07 09:34:49 I didn't immediately get this, how about: // Alwa
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 // Unregister, if disabled
Felix Dahlke 2013/08/07 09:34:49 This comment is kinda redundant, I think.
735 if (!settings->GetPluginEnabled())
736 {
737 s_mimeFilter->Unregister();
738 }
739
735 // Load theme module 740 // Load theme module
736
737
738 s_criticalSectionLocal.Lock(); 741 s_criticalSectionLocal.Lock();
739 { 742 {
740 if (!s_hUxtheme) 743 if (!s_hUxtheme)
741 { 744 {
742 s_hUxtheme = ::GetModuleHandle(_T("uxtheme.dll")); 745 s_hUxtheme = ::GetModuleHandle(_T("uxtheme.dll"));
743 if (s_hUxtheme) 746 if (s_hUxtheme)
744 { 747 {
745 pfnClose = (CLOSETHEMEDATA)::GetProcAddress(s_hUxtheme, "CloseThemeData" ); 748 pfnClose = (CLOSETHEMEDATA)::GetProcAddress(s_hUxtheme, "CloseThemeData" );
746 if (!pfnClose) 749 if (!pfnClose)
747 { 750 {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 814
812 if (CPluginClient::GetInstance()->IsFirstRun()) 815 if (CPluginClient::GetInstance()->IsFirstRun())
813 { 816 {
814 CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)CPluginClass::FirstRunThrea d, NULL, NULL, NULL); 817 CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)CPluginClass::FirstRunThrea d, NULL, NULL, NULL);
815 if ((m_hPaneWnd == NULL) || (!IsStatusBarEnabled())) 818 if ((m_hPaneWnd == NULL) || (!IsStatusBarEnabled()))
816 { 819 {
817 ShowStatusBar(); 820 ShowStatusBar();
818 } 821 }
819 822
820 } 823 }
821
822 CPluginSettings* settings = CPluginSettings::GetInstance();
823 return true; 824 return true;
824 } 825 }
825 826
826 bool CPluginClass::CreateStatusBarPane() 827 bool CPluginClass::CreateStatusBarPane()
827 { 828 {
828 DEBUG_GENERAL(L"Getting client"); 829 DEBUG_GENERAL(L"Getting client");
829 830
830 CPluginClient* client = CPluginClient::GetInstance(); 831 CPluginClient* client = CPluginClient::GetInstance();
831 832
832 DEBUG_GENERAL(L"Getting ieversion"); 833 DEBUG_GENERAL(L"Getting ieversion");
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after
1909 } 1910 }
1910 } 1911 }
1911 } 1912 }
1912 1913
1913 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); 1914 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT);
1914 } 1915 }
1915 1916
1916 return hTabWnd; 1917 return hTabWnd;
1917 1918
1918 } 1919 }
OLDNEW
« no previous file with comments | « no previous file | src/plugin/PluginDomTraverserBase.h » ('j') | src/plugin/PluginDomTraverserBase.h » ('J')

Powered by Google App Engine
This is Rietveld