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

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

Issue 6567422169448448: Issue 119 - Switch to injecting CSS for element hiding (Closed)
Patch Set: rebase and address comments Created April 13, 2015, 8:04 a.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/PluginTabBase.cpp ('k') | src/plugin/WebBrowserEventsListener.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #pragma once
2 #include <functional>
3 #include <memory>
4
5 class WebBrowserEventsListener;
6
7 typedef ATL::IDispEventImpl <1, WebBrowserEventsListener,
8 &__uuidof(DWebBrowserEvents2), &LIBID_SHDocVw, 1, 1> WebBrowserEvents2Listener ;
9
10 typedef ATL::IDispEventImpl <2, WebBrowserEventsListener,
11 &__uuidof(HTMLDocumentEvents2), &LIBID_MSHTML, 4, 0> HTMLDocumentEvents2Listen er;
12
13 class ATL_NO_VTABLE WebBrowserEventsListener :
14 public ATL::CComObjectRootEx<ATL::CComSingleThreadModel>,
15 public WebBrowserEvents2Listener,
16 public HTMLDocumentEvents2Listener,
17 public IUnknown
18 {
19 enum class State
20 {
21 FirstTimeLoading, Loading, Loaded
22 };
23 public:
24 typedef std::function<void()> OnDestroy;
25 typedef std::function<void()> OnReloaded;
26
27 WebBrowserEventsListener();
28 ~WebBrowserEventsListener();
29 BEGIN_COM_MAP(WebBrowserEventsListener)
30 COM_INTERFACE_ENTRY(IUnknown)
31 END_COM_MAP()
32
33 DECLARE_NOT_AGGREGATABLE(WebBrowserEventsListener)
34 BEGIN_SINK_MAP(WebBrowserEventsListener)
35 SINK_ENTRY_EX(1, __uuidof(DWebBrowserEvents2), DISPID_DOCUMENTCOMPLETE, OnDo cumentComplete)
36 SINK_ENTRY_EX(2, __uuidof(HTMLDocumentEvents2), DISPID_HTMLDOCUMENTEVENTS2_O NREADYSTATECHANGE, OnReadyStateChange)
37 END_SINK_MAP()
38
39 STDMETHOD(OnDocumentComplete)(IDispatch* pDisp, VARIANT* urlVariant);
40 STDMETHOD_(void, OnReadyStateChange)(IHTMLEventObj* pEvtObj);
41
42 DECLARE_PROTECT_FINAL_CONSTRUCT()
43
44 HRESULT FinalConstruct(){ return S_OK; }
45 void FinalRelease(){}
46 HRESULT Init(IWebBrowser2* webBrowser, const OnDestroy& onDestroy);
47
48 OnReloaded reloaded;
49 private:
50 void emitReloaded();
51 private:
52 ATL::CComPtr<IWebBrowser2> m_browser;
53 OnDestroy m_onDestroy;
54 bool m_isDocumentEvents2Connected;
55 State m_state;
56 };
OLDNEW
« no previous file with comments | « src/plugin/PluginTabBase.cpp ('k') | src/plugin/WebBrowserEventsListener.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld