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

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

Issue 6567422169448448: Issue 119 - Switch to injecting CSS for element hiding (Closed)
Patch Set: rename OnQuit Created Sept. 30, 2016, 3:25 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/AdblockPlusDomTraverser.cpp ('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-2016 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
(...skipping 22 matching lines...) Expand all
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 43 class WebBrowserEventsListener;
44 44
45 class ATL_NO_VTABLE CPluginClass : 45 class ATL_NO_VTABLE CPluginClass :
46 public ATL::CComObjectRootEx<ATL::CComMultiThreadModel>, 46 public ATL::CComObjectRootEx<ATL::CComMultiThreadModel>,
47 public ATL::CComCoClass<CPluginClass, &CLSID_PluginClass>, 47 public ATL::CComCoClass<CPluginClass, &CLSID_PluginClass>,
48 public ATL::IObjectWithSiteImpl<CPluginClass>, 48 public ATL::IObjectWithSiteImpl<CPluginClass>,
49 public IOleCommandTarget, 49 public IOleCommandTarget,
50 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>
51 { 51 {
52 52
53 friend class CPluginTab; 53 friend class CPluginTab;
54 54
55 private:
56
57 CPluginTab* m_tab;
58
59 public: 55 public:
60 56
61 DECLARE_REGISTRY_RESOURCEID(IDR_PLUGIN_CLASS) 57 DECLARE_REGISTRY_RESOURCEID(IDR_PLUGIN_CLASS)
62 58
63 DECLARE_PROTECT_FINAL_CONSTRUCT() 59 DECLARE_PROTECT_FINAL_CONSTRUCT()
64 60
65 BEGIN_COM_MAP(CPluginClass) 61 BEGIN_COM_MAP(CPluginClass)
66 COM_INTERFACE_ENTRY(IObjectWithSite) 62 COM_INTERFACE_ENTRY(IObjectWithSite)
67 COM_INTERFACE_ENTRY(IOleCommandTarget) 63 COM_INTERFACE_ENTRY(IOleCommandTarget)
68 END_COM_MAP() 64 END_COM_MAP()
69 65
70 BEGIN_SINK_MAP(CPluginClass) 66 BEGIN_SINK_MAP(CPluginClass)
71 SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_BEFORENAVIGATE2, OnBeforeNa vigate2) 67 SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_BEFORENAVIGATE2, OnBeforeNa vigate2)
72 SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_DOWNLOADCOMPLETE, OnDownloa dComplete) 68 SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_DOWNLOADCOMPLETE, OnDownloa dComplete)
73 SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_DOCUMENTCOMPLETE, OnDocumen tComplete)
74 SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_WINDOWSTATECHANGED, OnWindo wStateChanged) 69 SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_WINDOWSTATECHANGED, OnWindo wStateChanged)
75 SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_COMMANDSTATECHANGE, OnComma ndStateChange) 70 SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_COMMANDSTATECHANGE, OnComma ndStateChange)
76 SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_ONQUIT, OnOnQuit) 71 SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_ONQUIT, OnOnQuit)
77 END_SINK_MAP() 72 END_SINK_MAP()
78 73
79 CPluginClass(); 74 CPluginClass();
80 ~CPluginClass(); 75 ~CPluginClass();
81 76
82 // IObjectWithSite 77 // IObjectWithSite
83 STDMETHOD(SetSite)(IUnknown *pUnkSite); 78 STDMETHOD(SetSite)(IUnknown *pUnkSite);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 static void FirstRunThread(); 117 static void FirstRunThread();
123 118
124 void STDMETHODCALLTYPE OnBeforeNavigate2(IDispatch* pDisp /**< [in] */, 119 void STDMETHODCALLTYPE OnBeforeNavigate2(IDispatch* pDisp /**< [in] */,
125 VARIANT* URL /**< [in] */, 120 VARIANT* URL /**< [in] */,
126 VARIANT* Flags /**< [in] */, 121 VARIANT* Flags /**< [in] */,
127 VARIANT* TargetFrameName /**< [in] */ , 122 VARIANT* TargetFrameName /**< [in] */ ,
128 VARIANT* PostData /**< [in] */, 123 VARIANT* PostData /**< [in] */,
129 VARIANT* Headers /**< [in] */, 124 VARIANT* Headers /**< [in] */,
130 VARIANT_BOOL* Cancel /* [in, out] */) ; 125 VARIANT_BOOL* Cancel /* [in, out] */) ;
131 void STDMETHODCALLTYPE OnDownloadComplete(); 126 void STDMETHODCALLTYPE OnDownloadComplete();
132 void STDMETHODCALLTYPE OnDocumentComplete(IDispatch* frameBrowserDisp, VARIANT * /*urlOrPidl*/);
133 void STDMETHODCALLTYPE OnWindowStateChanged(unsigned long flags, unsigned long validFlagsMask); 127 void STDMETHODCALLTYPE OnWindowStateChanged(unsigned long flags, unsigned long validFlagsMask);
134 void STDMETHODCALLTYPE OnCommandStateChange(long command, VARIANT_BOOL enable) ; 128 void STDMETHODCALLTYPE OnCommandStateChange(long command, VARIANT_BOOL enable) ;
135 void STDMETHODCALLTYPE OnOnQuit(); 129 void STDMETHODCALLTYPE OnOnQuit();
136 void Unadvise(); 130 void Unadvise();
131 void EnsureWebBrowserConnected(const ATL::CComPtr<IWebBrowser2>& webBrowser);
137 132
138 void ShowStatusBar(); 133 void ShowStatusBar();
139 bool IsStatusBarEnabled(); 134 bool IsStatusBarEnabled();
140 135
141 /**
142 * A browser interface pointer to our site object
143 *
144 * It's values are set and reset solely in SetSite().
145 */
146 CComPtr<IWebBrowser2> m_webBrowser2;
147 HWND m_hBrowserWnd; 136 HWND m_hBrowserWnd;
148 HWND m_hTabWnd; 137 HWND m_hTabWnd;
149 HWND m_hStatusBarWnd; 138 HWND m_hStatusBarWnd;
150 HWND m_hPaneWnd; 139 HWND m_hPaneWnd;
151 140
152 WNDPROC m_pWndProcStatus; 141 WNDPROC m_pWndProcStatus;
153 int m_nPaneWidth; 142 int m_nPaneWidth;
154 HANDLE m_hTheme; 143 HANDLE m_hTheme;
144 struct Data
145 {
146 std::map<IWebBrowser2*, WebBrowserEventsListener*> connectedWebBrowsersCache ;
147 std::unique_ptr<CPluginTab> tab;
148 ATL::CComPtr<IWebBrowser2> webBrowser2;
149 };
150 // we need to have it as a shared pointer to get weak pointer to it to avoid
151 // wrong usage after destroying of this class.
152 std::shared_ptr<Data> m_data;
155 153
156 CriticalSection m_csStatusBar; 154 CriticalSection m_csStatusBar;
157 155
158 NotificationMessage notificationMessage; 156 NotificationMessage notificationMessage;
159 157
160 bool m_isAdvised; 158 bool m_isAdvised;
161 bool m_isInitializedOk; 159 bool m_isInitializedOk;
162 160
163 // Atom pane class 161 // Atom pane class
164 static ATOM s_atomPaneClass; 162 static ATOM s_atomPaneClass;
(...skipping 18 matching lines...) Expand all
183 181
184 // Async browser 182 // Async browser
185 static CComQIPtr<IWebBrowser2> s_asyncWebBrowser2; 183 static CComQIPtr<IWebBrowser2> s_asyncWebBrowser2;
186 static CComQIPtr<IWebBrowser2> GetAsyncBrowser(); 184 static CComQIPtr<IWebBrowser2> GetAsyncBrowser();
187 }; 185 };
188 186
189 OBJECT_ENTRY_AUTO(__uuidof(PluginClass), CPluginClass) 187 OBJECT_ENTRY_AUTO(__uuidof(PluginClass), CPluginClass)
190 188
191 189
192 #endif // _PLUGIN_CLASS_H_ 190 #endif // _PLUGIN_CLASS_H_
OLDNEW
« no previous file with comments | « src/plugin/AdblockPlusDomTraverser.cpp ('k') | src/plugin/PluginClass.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld