| LEFT | RIGHT |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2016 Eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
| 13 * | 13 * |
| (...skipping 20 matching lines...) Expand all Loading... |
| 34 #include "NotificationMessage.h" | 34 #include "NotificationMessage.h" |
| 35 | 35 |
| 36 #define ICON_PLUGIN_DISABLED 0 | 36 #define ICON_PLUGIN_DISABLED 0 |
| 37 #define ICON_PLUGIN_ENABLED 1 | 37 #define ICON_PLUGIN_ENABLED 1 |
| 38 #define ICON_PLUGIN_DEACTIVATED 2 | 38 #define ICON_PLUGIN_DEACTIVATED 2 |
| 39 #define ICON_MAX 3 | 39 #define ICON_MAX 3 |
| 40 | 40 |
| 41 #define WM_LAUNCH_INFO (WM_APP + 10) | 41 #define WM_LAUNCH_INFO (WM_APP + 10) |
| 42 | 42 |
| 43 class CPluginMimeFilterClient; | 43 class CPluginMimeFilterClient; |
| 44 | |
| 45 | 44 |
| 46 class ATL_NO_VTABLE CPluginClass : | 45 class ATL_NO_VTABLE CPluginClass : |
| 47 public ATL::CComObjectRootEx<ATL::CComMultiThreadModel>, | 46 public ATL::CComObjectRootEx<ATL::CComMultiThreadModel>, |
| 48 public ATL::CComCoClass<CPluginClass, &CLSID_PluginClass>, | 47 public ATL::CComCoClass<CPluginClass, &CLSID_PluginClass>, |
| 49 public ATL::IObjectWithSiteImpl<CPluginClass>, | 48 public ATL::IObjectWithSiteImpl<CPluginClass>, |
| 50 public IOleCommandTarget, | 49 public IOleCommandTarget, |
| 51 public ATL::IDispEventImpl<1, CPluginClass, &DIID_DWebBrowserEvents2, &LIBID_S
HDocVw, 1, 1> | 50 public ATL::IDispEventImpl<1, CPluginClass, &DIID_DWebBrowserEvents2, &LIBID_S
HDocVw, 1, 1> |
| 52 { | 51 { |
| 53 | 52 |
| 54 friend class CPluginTab; | 53 friend class CPluginTab; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 ~CPluginClass(); | 85 ~CPluginClass(); |
| 87 | 86 |
| 88 // IObjectWithSite | 87 // IObjectWithSite |
| 89 STDMETHOD(SetSite)(IUnknown *pUnkSite); | 88 STDMETHOD(SetSite)(IUnknown *pUnkSite); |
| 90 | 89 |
| 91 // IOleCommandTarget | 90 // IOleCommandTarget |
| 92 STDMETHOD(QueryStatus)(const GUID* pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[
], OLECMDTEXT* pCmdText); | 91 STDMETHOD(QueryStatus)(const GUID* pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[
], OLECMDTEXT* pCmdText); |
| 93 STDMETHOD(Exec)(const GUID*, DWORD nCmdID, DWORD, VARIANTARG*, VARIANTARG* pva
Out); | 92 STDMETHOD(Exec)(const GUID*, DWORD nCmdID, DWORD, VARIANTARG*, VARIANTARG* pva
Out); |
| 94 | 93 |
| 95 | 94 |
| 96 static CPluginTab* GetTab(DWORD dwThreadId); | 95 static CPluginTab* GetTabForCurrentThread(); |
| 97 CPluginTab* GetTab(); | 96 CPluginTab* GetTab(); |
| 98 | 97 |
| 99 void UpdateStatusBar(); | 98 void UpdateStatusBar(); |
| 100 | 99 |
| 101 private: | 100 private: |
| 102 | 101 |
| 103 bool SetMenuBar(HMENU hMenu, const std::wstring& url); | 102 bool SetMenuBar(HMENU hMenu, const std::wstring& url); |
| 104 HMENU CreatePluginMenu(const std::wstring& url); | 103 HMENU CreatePluginMenu(const std::wstring& url); |
| 105 | 104 |
| 106 void DisplayPluginMenu(HMENU hMenu, int nToolbarCmdID, POINT pt, UINT nMenuFla
gs); | 105 void DisplayPluginMenu(HMENU hMenu, int nToolbarCmdID, POINT pt, UINT nMenuFla
gs); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 static DWORD s_hIconTypes[ICON_MAX]; | 175 static DWORD s_hIconTypes[ICON_MAX]; |
| 177 | 176 |
| 178 static HICON GetIcon(int type); | 177 static HICON GetIcon(int type); |
| 179 | 178 |
| 180 // Main thread | 179 // Main thread |
| 181 static HANDLE s_hMainThread; | 180 static HANDLE s_hMainThread; |
| 182 static bool s_isMainThreadDone; | 181 static bool s_isMainThreadDone; |
| 183 | 182 |
| 184 static HINSTANCE s_hUxtheme; | 183 static HINSTANCE s_hUxtheme; |
| 185 static std::set<CPluginClass*> s_instances; | 184 static std::set<CPluginClass*> s_instances; |
| 186 static std::map<DWORD,CPluginClass*> s_threadInstances; | |
| 187 static CComAutoCriticalSection s_criticalSectionLocal; | 185 static CComAutoCriticalSection s_criticalSectionLocal; |
| 188 static CComAutoCriticalSection s_criticalSectionWindow; | 186 static CComAutoCriticalSection s_criticalSectionWindow; |
| 189 | 187 |
| 190 // Async browser | 188 // Async browser |
| 191 static CComQIPtr<IWebBrowser2> s_asyncWebBrowser2; | 189 static CComQIPtr<IWebBrowser2> s_asyncWebBrowser2; |
| 192 static CComQIPtr<IWebBrowser2> GetAsyncBrowser(); | 190 static CComQIPtr<IWebBrowser2> GetAsyncBrowser(); |
| 193 }; | 191 }; |
| 194 | 192 |
| 195 OBJECT_ENTRY_AUTO(__uuidof(PluginClass), CPluginClass) | 193 OBJECT_ENTRY_AUTO(__uuidof(PluginClass), CPluginClass) |
| 196 | 194 |
| 197 | |
| 198 #endif // _PLUGIN_CLASS_H_ | 195 #endif // _PLUGIN_CLASS_H_ |
| LEFT | RIGHT |