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 19 matching lines...) Expand all Loading... |
33 #include "NotificationMessage.h" | 33 #include "NotificationMessage.h" |
34 | 34 |
35 #define ICON_PLUGIN_DISABLED 0 | 35 #define ICON_PLUGIN_DISABLED 0 |
36 #define ICON_PLUGIN_ENABLED 1 | 36 #define ICON_PLUGIN_ENABLED 1 |
37 #define ICON_PLUGIN_DEACTIVATED 2 | 37 #define ICON_PLUGIN_DEACTIVATED 2 |
38 #define ICON_MAX 3 | 38 #define ICON_MAX 3 |
39 | 39 |
40 #define WM_LAUNCH_INFO (WM_APP + 10) | 40 #define WM_LAUNCH_INFO (WM_APP + 10) |
41 | 41 |
42 class CPluginMimeFilterClient; | 42 class CPluginMimeFilterClient; |
43 | |
44 | 43 |
45 class ATL_NO_VTABLE CPluginClass : | 44 class ATL_NO_VTABLE CPluginClass : |
46 public ATL::CComObjectRootEx<ATL::CComMultiThreadModel>, | 45 public ATL::CComObjectRootEx<ATL::CComMultiThreadModel>, |
47 public ATL::CComCoClass<CPluginClass, &CLSID_PluginClass>, | 46 public ATL::CComCoClass<CPluginClass, &CLSID_PluginClass>, |
48 public ATL::IObjectWithSiteImpl<CPluginClass>, | 47 public ATL::IObjectWithSiteImpl<CPluginClass>, |
49 public IOleCommandTarget, | 48 public IOleCommandTarget, |
50 public ATL::IDispEventImpl<1, CPluginClass, &DIID_DWebBrowserEvents2, &LIBID_S
HDocVw, 1, 1> | 49 public ATL::IDispEventImpl<1, CPluginClass, &DIID_DWebBrowserEvents2, &LIBID_S
HDocVw, 1, 1> |
51 { | 50 { |
52 | 51 |
53 friend class CPluginTab; | 52 friend class CPluginTab; |
(...skipping 27 matching lines...) Expand all Loading... |
81 ~CPluginClass(); | 80 ~CPluginClass(); |
82 | 81 |
83 // IObjectWithSite | 82 // IObjectWithSite |
84 STDMETHOD(SetSite)(IUnknown *pUnkSite); | 83 STDMETHOD(SetSite)(IUnknown *pUnkSite); |
85 | 84 |
86 // IOleCommandTarget | 85 // IOleCommandTarget |
87 STDMETHOD(QueryStatus)(const GUID* pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[
], OLECMDTEXT* pCmdText); | 86 STDMETHOD(QueryStatus)(const GUID* pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[
], OLECMDTEXT* pCmdText); |
88 STDMETHOD(Exec)(const GUID*, DWORD nCmdID, DWORD, VARIANTARG*, VARIANTARG* pva
Out); | 87 STDMETHOD(Exec)(const GUID*, DWORD nCmdID, DWORD, VARIANTARG*, VARIANTARG* pva
Out); |
89 | 88 |
90 | 89 |
91 static CPluginTab* GetTab(DWORD dwThreadId); | 90 static CPluginTab* GetTabForCurrentThread(); |
92 CPluginTab* GetTab(); | 91 CPluginTab* GetTab(); |
93 | 92 |
94 void UpdateStatusBar(); | 93 void UpdateStatusBar(); |
95 | 94 |
96 private: | 95 private: |
97 | 96 |
98 bool SetMenuBar(HMENU hMenu, const std::wstring& url); | 97 bool SetMenuBar(HMENU hMenu, const std::wstring& url); |
99 HMENU CreatePluginMenu(const std::wstring& url); | 98 HMENU CreatePluginMenu(const std::wstring& url); |
100 | 99 |
101 void DisplayPluginMenu(HMENU hMenu, int nToolbarCmdID, POINT pt, UINT nMenuFla
gs); | 100 void DisplayPluginMenu(HMENU hMenu, int nToolbarCmdID, POINT pt, UINT nMenuFla
gs); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 static HICON s_hIcons[ICON_MAX]; | 172 static HICON s_hIcons[ICON_MAX]; |
174 static DWORD s_hIconTypes[ICON_MAX]; | 173 static DWORD s_hIconTypes[ICON_MAX]; |
175 | 174 |
176 static HICON GetIcon(int type); | 175 static HICON GetIcon(int type); |
177 | 176 |
178 // Main thread | 177 // Main thread |
179 static HANDLE s_hMainThread; | 178 static HANDLE s_hMainThread; |
180 static bool s_isMainThreadDone; | 179 static bool s_isMainThreadDone; |
181 | 180 |
182 static HINSTANCE s_hUxtheme; | 181 static HINSTANCE s_hUxtheme; |
183 static std::map<DWORD,CPluginClass*> s_threadInstances; | |
184 static CComAutoCriticalSection s_criticalSectionLocal; | 182 static CComAutoCriticalSection s_criticalSectionLocal; |
185 static CComAutoCriticalSection s_criticalSectionWindow; | 183 static CComAutoCriticalSection s_criticalSectionWindow; |
186 }; | 184 }; |
187 | 185 |
188 OBJECT_ENTRY_AUTO(__uuidof(PluginClass), CPluginClass) | 186 OBJECT_ENTRY_AUTO(__uuidof(PluginClass), CPluginClass) |
189 | 187 |
190 | |
191 #endif // _PLUGIN_CLASS_H_ | 188 #endif // _PLUGIN_CLASS_H_ |
LEFT | RIGHT |