Index: src/plugin/PluginClass.h |
diff --git a/src/plugin/PluginClass.h b/src/plugin/PluginClass.h |
index 864b8b0e23a271c3d704548a886a4dce9592348e..d6f6fb30351dc2923b0a2add4c5fed5fee2e7074 100644 |
--- a/src/plugin/PluginClass.h |
+++ b/src/plugin/PluginClass.h |
@@ -40,7 +40,7 @@ |
#define WM_LAUNCH_INFO (WM_APP + 10) |
class CPluginMimeFilterClient; |
- |
+class WebBrowserEventsListener; |
class ATL_NO_VTABLE CPluginClass : |
public ATL::CComObjectRootEx<ATL::CComMultiThreadModel>, |
@@ -52,10 +52,6 @@ class ATL_NO_VTABLE CPluginClass : |
friend class CPluginTab; |
-private: |
- |
- CPluginTab* m_tab; |
- |
public: |
DECLARE_REGISTRY_RESOURCEID(IDR_PLUGIN_CLASS) |
@@ -70,7 +66,6 @@ public: |
BEGIN_SINK_MAP(CPluginClass) |
SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_BEFORENAVIGATE2, OnBeforeNavigate2) |
SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_DOWNLOADCOMPLETE, OnDownloadComplete) |
- SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_DOCUMENTCOMPLETE, OnDocumentComplete) |
SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_WINDOWSTATECHANGED, OnWindowStateChanged) |
SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_COMMANDSTATECHANGE, OnCommandStateChange) |
SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_ONQUIT, OnOnQuit) |
@@ -137,17 +132,15 @@ private: |
VARIANT* Headers /**< [in] */, |
VARIANT_BOOL* Cancel /* [in, out] */); |
void STDMETHODCALLTYPE OnDownloadComplete(); |
- void STDMETHODCALLTYPE OnDocumentComplete(IDispatch* frameBrowserDisp, VARIANT* /*urlOrPidl*/); |
void STDMETHODCALLTYPE OnWindowStateChanged(unsigned long flags, unsigned long validFlagsMask); |
void STDMETHODCALLTYPE OnCommandStateChange(long command, VARIANT_BOOL enable); |
void STDMETHODCALLTYPE OnOnQuit(); |
void Unadvise(); |
+ void EnsureWebBrowserConnected(const ATL::CComPtr<IWebBrowser2>& webBrowser); |
void ShowStatusBar(); |
bool IsStatusBarEnabled(); |
-public: |
- CComQIPtr<IWebBrowser2> m_webBrowser2; |
private: |
HWND m_hBrowserWnd; |
HWND m_hTabWnd; |
@@ -157,6 +150,15 @@ private: |
WNDPROC m_pWndProcStatus; |
int m_nPaneWidth; |
HANDLE m_hTheme; |
+ struct Data |
+ { |
+ std::map<IWebBrowser2*, WebBrowserEventsListener*> connectedWebBrowsersCache; |
+ std::unique_ptr<CPluginTab> tab; |
+ ATL::CComPtr<IWebBrowser2> webBrowser2; |
+ }; |
+ // we need to have it as a shared pointer to get weak pointer to it to avoid |
+ // wrong usage after destroying of this class. |
+ std::shared_ptr<Data> m_data; |
CriticalSection m_csStatusBar; |