| LEFT | RIGHT | 
|---|
| 1 /* | 1 /* | 
| 2 * http://msdn.microsoft.com/en-us/library/bb250436.aspx | 2 * http://msdn.microsoft.com/en-us/library/bb250436.aspx | 
| 3 */ | 3 */ | 
| 4 | 4 | 
| 5 #ifndef _PLUGIN_CLASS_H_ | 5 #ifndef _PLUGIN_CLASS_H_ | 
| 6 #define _PLUGIN_CLASS_H_ | 6 #define _PLUGIN_CLASS_H_ | 
| 7 | 7 | 
| 8 | 8 | 
| 9 #include "PluginTypedef.h" | 9 #include "PluginTypedef.h" | 
| 10 #include "Plugin.h" | 10 #include "Plugin.h" | 
| 11 #include "PluginTab.h" | 11 #include "PluginTab.h" | 
| 12 #define _CRTDBG_MAP_ALLOC | 12 #define _CRTDBG_MAP_ALLOC | 
| 13 #include <stdlib.h> | 13 #include <stdlib.h> | 
| 14 #include <crtdbg.h> | 14 #include <crtdbg.h> | 
| 15 #include <set> | 15 #include <set> | 
| 16 | 16 | 
| 17 #include "NotificationMessage.h" | 17 #include "NotificationMessage.h" | 
| 18 | 18 | 
| 19 #define ICON_PLUGIN_DISABLED 0 | 19 #define ICON_PLUGIN_DISABLED 0 | 
| 20 #define ICON_PLUGIN_ENABLED 1 | 20 #define ICON_PLUGIN_ENABLED 1 | 
| 21 #define ICON_PLUGIN_DEACTIVATED 2 | 21 #define ICON_PLUGIN_DEACTIVATED 2 | 
| 22 #define ICON_MAX 3 | 22 #define ICON_MAX 3 | 
| 23 | 23 | 
| 24 #define WM_LAUNCH_INFO                                  (WM_APP + 10) | 24 #define WM_LAUNCH_INFO                                  (WM_APP + 10) | 
| 25 #define WM_WHITELIST_DOMAIN                     (WM_LAUNCH_INFO + 1) |  | 
| 26 | 25 | 
| 27 class CPluginMimeFilterClient; | 26 class CPluginMimeFilterClient; | 
| 28 | 27 | 
| 29 | 28 | 
| 30 class ATL_NO_VTABLE CPluginClass : | 29 class ATL_NO_VTABLE CPluginClass : | 
| 31   public CComObjectRootEx<CComMultiThreadModel>, | 30   public CComObjectRootEx<CComMultiThreadModel>, | 
| 32   public CComCoClass<CPluginClass, &CLSID_PluginClass>, | 31   public CComCoClass<CPluginClass, &CLSID_PluginClass>, | 
| 33   public IObjectWithSiteImpl<CPluginClass>, | 32   public IObjectWithSiteImpl<CPluginClass>, | 
| 34   public IDispatchImpl<IIEPlugin, &IID_IIEPlugin, &LIBID_PluginLib>, | 33   public IDispatchImpl<IIEPlugin, &IID_IIEPlugin, &LIBID_PluginLib>, | 
| 35   public IOleCommandTarget | 34   public IOleCommandTarget | 
| 36 { | 35 { | 
| 37 | 36 | 
| 38   friend class CPluginTab; | 37   friend class CPluginTab; | 
| 39 | 38 | 
| 40 private: | 39 private: | 
| 41 | 40 | 
| 42   CPluginTab* m_tab; | 41   CPluginTab* m_tab; | 
| 43 | 42 | 
| 44 public: | 43 public: | 
| 45 | 44 | 
| 46   DECLARE_REGISTRY_RESOURCEID(IDR_PLUGIN_CLASS) | 45   DECLARE_REGISTRY_RESOURCEID(IDR_PLUGIN_CLASS) | 
| 47 | 46 | 
| 48   DECLARE_PROTECT_FINAL_CONSTRUCT() | 47   DECLARE_PROTECT_FINAL_CONSTRUCT() | 
| 49 | 48 | 
| 50   BEGIN_COM_MAP(CPluginClass) | 49   BEGIN_COM_MAP(CPluginClass) | 
| 51     COM_INTERFACE_ENTRY(IIEPlugin) | 50     COM_INTERFACE_ENTRY(IIEPlugin) | 
| 52     COM_INTERFACE_ENTRY(IDispatch) | 51     COM_INTERFACE_ENTRY(IDispatch) | 
| 53     COM_INTERFACE_ENTRY_IMPL(IObjectWithSite) | 52     COM_INTERFACE_ENTRY(IObjectWithSite) | 
| 54     COM_INTERFACE_ENTRY(IOleCommandTarget) | 53     COM_INTERFACE_ENTRY(IOleCommandTarget) | 
| 55   END_COM_MAP() | 54   END_COM_MAP() | 
| 56 | 55 | 
| 57   CPluginClass(); | 56   CPluginClass(); | 
| 58   ~CPluginClass(); | 57   ~CPluginClass(); | 
| 59 | 58 | 
| 60   HRESULT FinalConstruct(); | 59   HRESULT FinalConstruct(); | 
| 61   void FinalRelease(); | 60   void FinalRelease(); | 
| 62 | 61 | 
| 63   // IObjectWithSite | 62   // IObjectWithSite | 
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 155   // Main thread | 154   // Main thread | 
| 156   static HANDLE s_hMainThread; | 155   static HANDLE s_hMainThread; | 
| 157   static bool s_isMainThreadDone; | 156   static bool s_isMainThreadDone; | 
| 158 | 157 | 
| 159   static HANDLE GetMainThreadHandle(); | 158   static HANDLE GetMainThreadHandle(); | 
| 160   static bool IsMainThreadDone(HANDLE mainThread); | 159   static bool IsMainThreadDone(HANDLE mainThread); | 
| 161 | 160 | 
| 162   static HINSTANCE s_hUxtheme; | 161   static HINSTANCE s_hUxtheme; | 
| 163   static std::set<CPluginClass*> s_instances; | 162   static std::set<CPluginClass*> s_instances; | 
| 164   static std::map<DWORD,CPluginClass*> s_threadInstances; | 163   static std::map<DWORD,CPluginClass*> s_threadInstances; | 
| 165   static std::map<UINT, CString> s_menuDomains; |  | 
| 166   static CComAutoCriticalSection s_criticalSectionLocal; | 164   static CComAutoCriticalSection s_criticalSectionLocal; | 
| 167   static CComAutoCriticalSection s_criticalSectionBrowser; | 165   static CComAutoCriticalSection s_criticalSectionBrowser; | 
| 168   static CComAutoCriticalSection s_criticalSectionWindow; | 166   static CComAutoCriticalSection s_criticalSectionWindow; | 
| 169   static CComAutoCriticalSection s_criticalSectionWhiteList; |  | 
| 170 | 167 | 
| 171   // Async browser | 168   // Async browser | 
| 172   static CComQIPtr<IWebBrowser2> s_asyncWebBrowser2; | 169   static CComQIPtr<IWebBrowser2> s_asyncWebBrowser2; | 
| 173   static CComQIPtr<IWebBrowser2> GetAsyncBrowser(); | 170   static CComQIPtr<IWebBrowser2> GetAsyncBrowser(); | 
| 174 }; | 171 }; | 
| 175 | 172 | 
| 176 OBJECT_ENTRY_AUTO(__uuidof(PluginClass), CPluginClass) | 173 OBJECT_ENTRY_AUTO(__uuidof(PluginClass), CPluginClass) | 
| 177 | 174 | 
| 178 | 175 | 
| 179 #endif // _PLUGIN_CLASS_H_ | 176 #endif // _PLUGIN_CLASS_H_ | 
| LEFT | RIGHT | 
|---|