| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome_frame/chrome_frame_activex.h" | 5 #include "chrome_frame/chrome_frame_activex.h" |
| 6 | 6 |
| 7 #include <wininet.h> | 7 #include <wininet.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 GURL* url) { | 141 GURL* url) { |
| 142 *referrer = params.frame_url.is_empty() ? params.page_url : params.frame_url; | 142 *referrer = params.frame_url.is_empty() ? params.page_url : params.frame_url; |
| 143 *url = (cmd == IDS_CONTENT_CONTEXT_SAVELINKAS ? | 143 *url = (cmd == IDS_CONTENT_CONTEXT_SAVELINKAS ? |
| 144 params.link_url : params.src_url); | 144 params.link_url : params.src_url); |
| 145 } | 145 } |
| 146 | 146 |
| 147 } // namespace chrome_frame | 147 } // namespace chrome_frame |
| 148 | 148 |
| 149 ChromeFrameActivex::ChromeFrameActivex() | 149 ChromeFrameActivex::ChromeFrameActivex() |
| 150 : chrome_wndproc_hook_(NULL) { | 150 : chrome_wndproc_hook_(NULL) { |
| 151 TRACE_EVENT_BEGIN("chromeframe.createactivex", this, ""); | 151 TRACE_EVENT_BEGIN_ETW("chromeframe.createactivex", this, ""); |
| 152 } | 152 } |
| 153 | 153 |
| 154 HRESULT ChromeFrameActivex::FinalConstruct() { | 154 HRESULT ChromeFrameActivex::FinalConstruct() { |
| 155 HRESULT hr = Base::FinalConstruct(); | 155 HRESULT hr = Base::FinalConstruct(); |
| 156 if (FAILED(hr)) | 156 if (FAILED(hr)) |
| 157 return hr; | 157 return hr; |
| 158 | 158 |
| 159 // No need to call FireOnChanged at this point since nobody will be listening. | 159 // No need to call FireOnChanged at this point since nobody will be listening. |
| 160 ready_state_ = READYSTATE_LOADING; | 160 ready_state_ = READYSTATE_LOADING; |
| 161 return S_OK; | 161 return S_OK; |
| 162 } | 162 } |
| 163 | 163 |
| 164 ChromeFrameActivex::~ChromeFrameActivex() { | 164 ChromeFrameActivex::~ChromeFrameActivex() { |
| 165 // We expect these to be released during a call to SetClientSite(NULL). | 165 // We expect these to be released during a call to SetClientSite(NULL). |
| 166 DCHECK_EQ(0u, onmessage_.size()); | 166 DCHECK_EQ(0u, onmessage_.size()); |
| 167 DCHECK_EQ(0u, onloaderror_.size()); | 167 DCHECK_EQ(0u, onloaderror_.size()); |
| 168 DCHECK_EQ(0u, onload_.size()); | 168 DCHECK_EQ(0u, onload_.size()); |
| 169 DCHECK_EQ(0u, onreadystatechanged_.size()); | 169 DCHECK_EQ(0u, onreadystatechanged_.size()); |
| 170 DCHECK_EQ(0u, onextensionready_.size()); | 170 DCHECK_EQ(0u, onextensionready_.size()); |
| 171 | 171 |
| 172 if (chrome_wndproc_hook_) { | 172 if (chrome_wndproc_hook_) { |
| 173 BOOL unhook_success = ::UnhookWindowsHookEx(chrome_wndproc_hook_); | 173 BOOL unhook_success = ::UnhookWindowsHookEx(chrome_wndproc_hook_); |
| 174 DCHECK(unhook_success); | 174 DCHECK(unhook_success); |
| 175 } | 175 } |
| 176 | 176 |
| 177 // ChromeFramePlugin::Uninitialize() | 177 // ChromeFramePlugin::Uninitialize() |
| 178 Base::Uninitialize(); | 178 Base::Uninitialize(); |
| 179 | 179 |
| 180 TRACE_EVENT_END("chromeframe.createactivex", this, ""); | 180 TRACE_EVENT_END_ETW("chromeframe.createactivex", this, ""); |
| 181 } | 181 } |
| 182 | 182 |
| 183 LRESULT ChromeFrameActivex::OnCreate(UINT message, WPARAM wparam, LPARAM lparam, | 183 LRESULT ChromeFrameActivex::OnCreate(UINT message, WPARAM wparam, LPARAM lparam, |
| 184 BOOL& handled) { | 184 BOOL& handled) { |
| 185 Base::OnCreate(message, wparam, lparam, handled); | 185 Base::OnCreate(message, wparam, lparam, handled); |
| 186 // Install the notification hook on the top-level window, so that we can | 186 // Install the notification hook on the top-level window, so that we can |
| 187 // be notified on move events. Note that the return value is not checked. | 187 // be notified on move events. Note that the return value is not checked. |
| 188 // This hook is installed here, as opposed to during IOleObject_SetClientSite | 188 // This hook is installed here, as opposed to during IOleObject_SetClientSite |
| 189 // because m_hWnd has not yet been assigned during the SetSite call. | 189 // because m_hWnd has not yet been assigned during the SetSite call. |
| 190 InstallTopLevelHook(m_spClientSite); | 190 InstallTopLevelHook(m_spClientSite); |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 if (FAILED(hr)) { | 683 if (FAILED(hr)) { |
| 684 NOTREACHED() << "ChromeFrame BHO SetSite failed. Error:" | 684 NOTREACHED() << "ChromeFrame BHO SetSite failed. Error:" |
| 685 << base::StringPrintf(" 0x%08X", hr); | 685 << base::StringPrintf(" 0x%08X", hr); |
| 686 return hr; | 686 return hr; |
| 687 } | 687 } |
| 688 | 688 |
| 689 web_browser2->PutProperty(base::win::ScopedBstr(bho_class_id_as_string), | 689 web_browser2->PutProperty(base::win::ScopedBstr(bho_class_id_as_string), |
| 690 base::win::ScopedVariant(bho)); | 690 base::win::ScopedVariant(bho)); |
| 691 return S_OK; | 691 return S_OK; |
| 692 } | 692 } |
| OLD | NEW |