diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-20 23:28:52 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-20 23:28:52 +0000 |
commit | 830005dd23868ae6a4fe75dab08c08ee04831ca2 (patch) | |
tree | db98eda277bb2a78e00b4424116f22e76f624d40 /chrome_frame | |
parent | 29c32f903806efbc167a417c170b896dfeecc33f (diff) | |
download | chromium_src-830005dd23868ae6a4fe75dab08c08ee04831ca2.zip chromium_src-830005dd23868ae6a4fe75dab08c08ee04831ca2.tar.gz chromium_src-830005dd23868ae6a4fe75dab08c08ee04831ca2.tar.bz2 |
In ChromeFrame with the moniker patch enabled we should not process optin urls in the BHO.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=42155
Bug=42155
Review URL: http://codereview.chromium.org/1706003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45117 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/bho.cc | 9 | ||||
-rw-r--r-- | chrome_frame/test/test_mock_with_web_server.cc | 2 | ||||
-rw-r--r-- | chrome_frame/test/test_with_web_server.cc | 9 | ||||
-rw-r--r-- | chrome_frame/utils.cc | 14 | ||||
-rw-r--r-- | chrome_frame/utils.h | 7 |
5 files changed, 25 insertions, 16 deletions
diff --git a/chrome_frame/bho.cc b/chrome_frame/bho.cc index 5ea51125..7ca9bff 100644 --- a/chrome_frame/bho.cc +++ b/chrome_frame/bho.cc @@ -121,9 +121,10 @@ STDMETHODIMP Bho::BeforeNavigate2(IDispatch* dispatch, VARIANT* url, if (is_top_level) { set_url(url->bstrVal); set_referrer(""); - ProcessOptInUrls(web_browser2, url->bstrVal); + if (!MonikerPatchEnabled()) { + ProcessOptInUrls(web_browser2, url->bstrVal); + } } - return S_OK; } @@ -314,9 +315,7 @@ bool PatchHelper::InitializeAndPatchProtocolsIfNeeded() { HttpNegotiatePatch::Initialize(); - ProtocolPatchMethod patch_method = - static_cast<ProtocolPatchMethod>( - GetConfigInt(PATCH_METHOD_MONIKER, kPatchProtocols)); + ProtocolPatchMethod patch_method = GetPatchMethod(); if (patch_method == PATCH_METHOD_INET_PROTOCOL) { ProtocolSinkWrap::PatchProtocolHandlers(); state_ = PATCH_PROTOCOL; diff --git a/chrome_frame/test/test_mock_with_web_server.cc b/chrome_frame/test/test_mock_with_web_server.cc index b68f481..03e0a00 100644 --- a/chrome_frame/test/test_mock_with_web_server.cc +++ b/chrome_frame/test/test_mock_with_web_server.cc @@ -26,8 +26,6 @@ const wchar_t enter_key[] = { VK_RETURN, 0 }; const wchar_t escape_key[] = { VK_ESCAPE, 0 }; const wchar_t tab_enter_keys[] = { VK_TAB, VK_RETURN, 0 }; -bool MonikerPatchEnabled(); - // A convenience class to close all open IE windows at the end // of a scope. It's more convenient to do it this way than to // explicitly call chrome_frame_test::CloseAllIEWindows at the diff --git a/chrome_frame/test/test_with_web_server.cc b/chrome_frame/test/test_with_web_server.cc index 2248089..9e9e14f2 100644 --- a/chrome_frame/test/test_with_web_server.cc +++ b/chrome_frame/test/test_with_web_server.cc @@ -16,15 +16,6 @@ const int kShortWaitTimeout = 25 * 1000; const int kChromeFrameLaunchDelay = 5; const int kChromeFrameLongNavigationTimeoutInSeconds = 10; -bool MonikerPatchEnabled() { - ProtocolPatchMethod patch_method = - static_cast<ProtocolPatchMethod>( - GetConfigInt(PATCH_METHOD_MONIKER, kPatchProtocols)); - LOG_IF(ERROR, patch_method != PATCH_METHOD_MONIKER) - << "Not running test. Moniker patch not enabled."; - return patch_method == PATCH_METHOD_MONIKER; -} - class ChromeFrameTestEnvironment: public testing::Environment { public: ~ChromeFrameTestEnvironment() {} diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc index 1bc13ac..52489a1 100644 --- a/chrome_frame/utils.cc +++ b/chrome_frame/utils.cc @@ -1057,3 +1057,17 @@ int GetHttpResponseStatusFromBinding(IBinding* binding) { return http_status; } + +ProtocolPatchMethod GetPatchMethod() { + ProtocolPatchMethod patch_method = + static_cast<ProtocolPatchMethod>( + GetConfigInt(PATCH_METHOD_MONIKER, kPatchProtocols)); + return patch_method; +} + +bool MonikerPatchEnabled() { + ProtocolPatchMethod patch_method = GetPatchMethod(); + LOG_IF(ERROR, patch_method != PATCH_METHOD_MONIKER) + << "Not running test. Moniker patch not enabled."; + return patch_method == PATCH_METHOD_MONIKER; +} diff --git a/chrome_frame/utils.h b/chrome_frame/utils.h index 5591ff09..d8731ec 100644 --- a/chrome_frame/utils.h +++ b/chrome_frame/utils.h @@ -424,4 +424,11 @@ std::string GetHttpHeadersFromBinding(IBinding* binding); // Returns the HTTP response code from the binding passed in. int GetHttpResponseStatusFromBinding(IBinding* binding); +// Returns the desired patch method (moniker, http_equiv, protocol sink). +// Defaults to moniker patch. +ProtocolPatchMethod GetPatchMethod(); + +// Returns true if the IMoniker patch is enabled. +bool MonikerPatchEnabled(); + #endif // CHROME_FRAME_UTILS_H_ |