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-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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // We can get here when readyStateChanged("complete") is already received, | 52 // We can get here when readyStateChanged("complete") is already received, |
53 // don't emit reloaded, because it's already emitted from OnReadyStateChange. | 53 // don't emit reloaded, because it's already emitted from OnReadyStateChange. |
54 if (m_state == State::FirstTimeLoading) | 54 if (m_state == State::FirstTimeLoading) |
55 { | 55 { |
56 m_state = State::Loaded; | 56 m_state = State::Loaded; |
57 emitReloaded(); | 57 emitReloaded(); |
58 } | 58 } |
59 return S_OK; | 59 return S_OK; |
60 } | 60 } |
61 | 61 |
62 void STDMETHODCALLTYPE WebBrowserEventsListener::OnOnQuit() | 62 void STDMETHODCALLTYPE WebBrowserEventsListener::OnQuit() |
63 { | 63 { |
64 if (m_isDocumentEvents2Connected) | 64 if (m_isDocumentEvents2Connected) |
65 { | 65 { |
66 ATL::CComPtr<IDispatch> dispDocument; | 66 ATL::CComPtr<IDispatch> dispDocument; |
67 ATL::CComQIPtr<IHTMLDocument2> htmlDocument2; | 67 ATL::CComQIPtr<IHTMLDocument2> htmlDocument2; |
68 if (SUCCEEDED(m_browser->get_Document(&dispDocument)) && (htmlDocument2 = di
spDocument)) | 68 if (SUCCEEDED(m_browser->get_Document(&dispDocument)) && (htmlDocument2 = di
spDocument)) |
69 { | 69 { |
70 HTMLDocumentEvents2Listener::DispEventUnadvise(htmlDocument2); | 70 HTMLDocumentEvents2Listener::DispEventUnadvise(htmlDocument2); |
71 } | 71 } |
72 } | 72 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 return S_OK; | 155 return S_OK; |
156 } | 156 } |
157 | 157 |
158 void WebBrowserEventsListener::emitReloaded() | 158 void WebBrowserEventsListener::emitReloaded() |
159 { | 159 { |
160 if (m_onReloaded) | 160 if (m_onReloaded) |
161 { | 161 { |
162 m_onReloaded(); | 162 m_onReloaded(); |
163 } | 163 } |
164 } | 164 } |
LEFT | RIGHT |