| 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/bho.h" | 5 #include "chrome_frame/bho.h" |
| 6 | 6 |
| 7 #include <shlguid.h> | 7 #include <shlguid.h> |
| 8 | 8 |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
| 14 #include "base/win/scoped_bstr.h" | 14 #include "base/win/scoped_bstr.h" |
| 15 #include "chrome_tab.h" // NOLINT | 15 #include "chrome_frame/buggy_bho_handling.h" |
| 16 #include "chrome_frame/crash_reporting/crash_metrics.h" | 16 #include "chrome_frame/crash_reporting/crash_metrics.h" |
| 17 #include "chrome_frame/extra_system_apis.h" | 17 #include "chrome_frame/extra_system_apis.h" |
| 18 #include "chrome_frame/html_utils.h" | 18 #include "chrome_frame/html_utils.h" |
| 19 #include "chrome_frame/http_negotiate.h" | 19 #include "chrome_frame/http_negotiate.h" |
| 20 #include "chrome_frame/metrics_service.h" | 20 #include "chrome_frame/metrics_service.h" |
| 21 #include "chrome_frame/protocol_sink_wrap.h" | 21 #include "chrome_frame/protocol_sink_wrap.h" |
| 22 #include "chrome_frame/ready_mode/ready_mode.h" | 22 #include "chrome_frame/ready_mode/ready_mode.h" |
| 23 #include "chrome_frame/urlmon_moniker.h" | 23 #include "chrome_frame/urlmon_moniker.h" |
| 24 #include "chrome_frame/utils.h" | 24 #include "chrome_frame/utils.h" |
| 25 #include "chrome_frame/vtable_patch_manager.h" | 25 #include "chrome_frame/vtable_patch_manager.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 // Save away our BHO instance in TLS which enables it to be referenced by | 133 // Save away our BHO instance in TLS which enables it to be referenced by |
| 134 // our active document/activex instances to query referrer and other | 134 // our active document/activex instances to query referrer and other |
| 135 // information for a URL. | 135 // information for a URL. |
| 136 AddRef(); | 136 AddRef(); |
| 137 RegisterThreadInstance(); | 137 RegisterThreadInstance(); |
| 138 MetricsService::Start(); | 138 MetricsService::Start(); |
| 139 } else { | 139 } else { |
| 140 UnregisterThreadInstance(); | 140 UnregisterThreadInstance(); |
| 141 buggy_bho::BuggyBhoTls::DestroyInstance(); |
| 142 ScopedComPtr<IWebBrowser2> web_browser2; |
| 143 web_browser2.QueryFrom(m_spUnkSite); |
| 144 DispEventUnadvise(web_browser2, &DIID_DWebBrowserEvents2); |
| 141 Release(); | 145 Release(); |
| 142 } | 146 } |
| 143 | 147 |
| 144 return IObjectWithSiteImpl<Bho>::SetSite(site); | 148 return IObjectWithSiteImpl<Bho>::SetSite(site); |
| 145 } | 149 } |
| 146 | 150 |
| 147 STDMETHODIMP Bho::BeforeNavigate2(IDispatch* dispatch, VARIANT* url, | 151 STDMETHODIMP Bho::BeforeNavigate2(IDispatch* dispatch, VARIANT* url, |
| 148 VARIANT* flags, VARIANT* target_frame_name, VARIANT* post_data, | 152 VARIANT* flags, VARIANT* target_frame_name, VARIANT* post_data, |
| 149 VARIANT* headers, VARIANT_BOOL* cancel) { | 153 VARIANT* headers, VARIANT_BOOL* cancel) { |
| 150 if (!url || url->vt != VT_BSTR || url->bstrVal == NULL) { | 154 if (!url || url->vt != VT_BSTR || url->bstrVal == NULL) { |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 } | 384 } |
| 381 } | 385 } |
| 382 | 386 |
| 383 void PatchHelper::UnpatchIfNeeded() { | 387 void PatchHelper::UnpatchIfNeeded() { |
| 384 if (state_ == PATCH_PROTOCOL) { | 388 if (state_ == PATCH_PROTOCOL) { |
| 385 g_trans_hooks.RevertHooks(); | 389 g_trans_hooks.RevertHooks(); |
| 386 HttpNegotiatePatch::Uninitialize(); | 390 HttpNegotiatePatch::Uninitialize(); |
| 387 } | 391 } |
| 388 state_ = UNKNOWN; | 392 state_ = UNKNOWN; |
| 389 } | 393 } |
| OLD | NEW |