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

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

Issue 29330403: Issue #1467, #3397 - Rewrite the map from threads to tabs (Closed)
Patch Set: Created Nov. 22, 2015, 8:17 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
« no previous file with comments | « src/plugin/Instances.h ('k') | src/plugin/PluginClass.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-2015 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
(...skipping 23 matching lines...) Expand all
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 43
44
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;
54 53
(...skipping 25 matching lines...) Expand all
80 ~CPluginClass(); 79 ~CPluginClass();
81 80
82 // IObjectWithSite 81 // IObjectWithSite
83 STDMETHOD(SetSite)(IUnknown *pUnkSite); 82 STDMETHOD(SetSite)(IUnknown *pUnkSite);
84 83
85 // IOleCommandTarget 84 // IOleCommandTarget
86 STDMETHOD(QueryStatus)(const GUID* pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[ ], OLECMDTEXT* pCmdText); 85 STDMETHOD(QueryStatus)(const GUID* pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[ ], OLECMDTEXT* pCmdText);
87 STDMETHOD(Exec)(const GUID*, DWORD nCmdID, DWORD, VARIANTARG*, VARIANTARG* pva Out); 86 STDMETHOD(Exec)(const GUID*, DWORD nCmdID, DWORD, VARIANTARG*, VARIANTARG* pva Out);
88 87
89 88
90 static CPluginTab* GetTab(DWORD dwThreadId); 89 static CPluginTab* GetTabCurrentThread();
91 CPluginTab* GetTab(); 90 CPluginTab* GetTab();
92 91
93 void UpdateStatusBar(); 92 void UpdateStatusBar();
94 93
95 private: 94 private:
96 95
97 bool SetMenuBar(HMENU hMenu, const std::wstring& url); 96 bool SetMenuBar(HMENU hMenu, const std::wstring& url);
98 HMENU CreatePluginMenu(const std::wstring& url); 97 HMENU CreatePluginMenu(const std::wstring& url);
99 98
100 void DisplayPluginMenu(HMENU hMenu, int nToolbarCmdID, POINT pt, UINT nMenuFla gs); 99 void DisplayPluginMenu(HMENU hMenu, int nToolbarCmdID, POINT pt, UINT nMenuFla gs);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 static DWORD s_hIconTypes[ICON_MAX]; 172 static DWORD s_hIconTypes[ICON_MAX];
174 173
175 static HICON GetIcon(int type); 174 static HICON GetIcon(int type);
176 175
177 // Main thread 176 // Main thread
178 static HANDLE s_hMainThread; 177 static HANDLE s_hMainThread;
179 static bool s_isMainThreadDone; 178 static bool s_isMainThreadDone;
180 179
181 static HINSTANCE s_hUxtheme; 180 static HINSTANCE s_hUxtheme;
182 static std::set<CPluginClass*> s_instances; 181 static std::set<CPluginClass*> s_instances;
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 // Async browser 185 // Async browser
188 static CComQIPtr<IWebBrowser2> s_asyncWebBrowser2; 186 static CComQIPtr<IWebBrowser2> s_asyncWebBrowser2;
189 static CComQIPtr<IWebBrowser2> GetAsyncBrowser(); 187 static CComQIPtr<IWebBrowser2> GetAsyncBrowser();
190 }; 188 };
191 189
192 OBJECT_ENTRY_AUTO(__uuidof(PluginClass), CPluginClass) 190 OBJECT_ENTRY_AUTO(__uuidof(PluginClass), CPluginClass)
193 191
194
195 #endif // _PLUGIN_CLASS_H_ 192 #endif // _PLUGIN_CLASS_H_
OLDNEW
« no previous file with comments | « src/plugin/Instances.h ('k') | src/plugin/PluginClass.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld