diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-09 00:36:05 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-09 00:36:05 +0000 |
commit | e7f249b1630ebd949f11a466ce523d069550f5a4 (patch) | |
tree | 8d27fa7a80ff2f1eb0d2699c235e8d371795fa27 /ceee | |
parent | 2b13d1d7f17e2ddb31e9f7a4bf480835649fff55 (diff) | |
download | chromium_src-e7f249b1630ebd949f11a466ce523d069550f5a4.zip chromium_src-e7f249b1630ebd949f11a466ce523d069550f5a4.tar.gz chromium_src-e7f249b1630ebd949f11a466ce523d069550f5a4.tar.bz2 |
Add a registry flag, so that we can enable/disable webRequest and webNavigation APIs on IE CEEE.
(landing for yzshen@chromium.org)
BUG=65952
TEST=none
Review URL: http://codereview.chromium.org/5635010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68677 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ceee')
-rw-r--r-- | ceee/ie/common/ceee_module_util.cc | 10 | ||||
-rw-r--r-- | ceee/ie/common/ceee_module_util.h | 5 | ||||
-rw-r--r-- | ceee/ie/common/mock_ceee_module_util.h | 6 | ||||
-rw-r--r-- | ceee/ie/plugin/bho/browser_helper_object.cc | 14 | ||||
-rw-r--r-- | ceee/ie/plugin/bho/browser_helper_object_unittest.cc | 8 | ||||
-rw-r--r-- | ceee/ie/plugin/bho/mediumtest_browser_helper_object.cc | 2 |
6 files changed, 37 insertions, 8 deletions
diff --git a/ceee/ie/common/ceee_module_util.cc b/ceee/ie/common/ceee_module_util.cc index 930520f..3e18dbc 100644 --- a/ceee/ie/common/ceee_module_util.cc +++ b/ceee/ie/common/ceee_module_util.cc @@ -26,6 +26,8 @@ const wchar_t* kRegistryValueCrxInstalledPath = L"crx_installed_path"; const wchar_t* kRegistryValueCrxInstalledTime = L"crx_installed_time"; const wchar_t* kRegistryValueCrxInstalledByVersion = L"crx_installed_runtime_version"; +const wchar_t* kRegistryValueEnableWebProgressApis = + L"enable_webnav_webreq_apis"; // Global state needed by the BHO and the // toolband, to indicate whether ShowDW calls should affect @@ -244,6 +246,14 @@ bool GetOptionToolbandForceReposition() { return !GetCeeeRegistryBoolean(kRegistryValueToolbandPlaced, false); } +void SetOptionEnableWebProgressApis(bool enable) { + SetCeeeRegistryBoolean(kRegistryValueEnableWebProgressApis, enable); +} + +bool GetOptionEnableWebProgressApis() { + return GetCeeeRegistryBoolean(kRegistryValueEnableWebProgressApis, false); +} + void SetIgnoreShowDWChanges(bool ignore) { if (ignore) { ::InterlockedIncrement(&g_ignore_show_dw_changes); diff --git a/ceee/ie/common/ceee_module_util.h b/ceee/ie/common/ceee_module_util.h index d7f8bf9..bb1291f 100644 --- a/ceee/ie/common/ceee_module_util.h +++ b/ceee/ie/common/ceee_module_util.h @@ -74,6 +74,11 @@ bool GetOptionToolbandIsHidden(); void SetOptionToolbandForceReposition(bool reposition_next_time); bool GetOptionToolbandForceReposition(); +// Stores/reads a registry entry that tracks whether to enable the Web progress +// APIs (webNavigation and webRequest). +void SetOptionEnableWebProgressApis(bool enable); +bool GetOptionEnableWebProgressApis(); + // Indicates whether ShowDW calls should affect registry tracking of the // user's visibility preference. void SetIgnoreShowDWChanges(bool ignore); diff --git a/ceee/ie/common/mock_ceee_module_util.h b/ceee/ie/common/mock_ceee_module_util.h index af70657..80e58b5 100644 --- a/ceee/ie/common/mock_ceee_module_util.h +++ b/ceee/ie/common/mock_ceee_module_util.h @@ -22,6 +22,10 @@ MOCK_STATIC_CLASS_BEGIN(MockCeeeModuleUtils) SetOptionToolbandForceReposition); MOCK_STATIC_INIT2(ceee_module_util::GetOptionToolbandForceReposition, GetOptionToolbandForceReposition); + MOCK_STATIC_INIT2(ceee_module_util::SetOptionEnableWebProgressApis, + SetOptionEnableWebProgressApis); + MOCK_STATIC_INIT2(ceee_module_util::GetOptionEnableWebProgressApis, + GetOptionEnableWebProgressApis); MOCK_STATIC_INIT2(ceee_module_util::SetIgnoreShowDWChanges, SetIgnoreShowDWChanges); MOCK_STATIC_INIT2(ceee_module_util::GetIgnoreShowDWChanges, @@ -33,6 +37,8 @@ MOCK_STATIC_CLASS_BEGIN(MockCeeeModuleUtils) MOCK_STATIC0(bool, , GetOptionToolbandIsHidden); MOCK_STATIC1(void, , SetOptionToolbandForceReposition, bool); MOCK_STATIC0(bool, , GetOptionToolbandForceReposition); + MOCK_STATIC1(void, , SetOptionEnableWebProgressApis, bool); + MOCK_STATIC0(bool, , GetOptionEnableWebProgressApis); MOCK_STATIC1(void, , SetIgnoreShowDWChanges, bool); MOCK_STATIC0(bool, , GetIgnoreShowDWChanges); MOCK_STATIC0(std::wstring, , GetExtensionPath); diff --git a/ceee/ie/plugin/bho/browser_helper_object.cc b/ceee/ie/plugin/bho/browser_helper_object.cc index 2599de8..8e026c4 100644 --- a/ceee/ie/plugin/bho/browser_helper_object.cc +++ b/ceee/ie/plugin/bho/browser_helper_object.cc @@ -397,12 +397,14 @@ HRESULT BrowserHelperObject::Initialize(IUnknown* site) { CheckToolBandVisibility(web_browser_); - web_progress_notifier_.reset(CreateWebProgressNotifier()); - DCHECK(web_progress_notifier_ != NULL) - << "Failed to initialize WebProgressNotifier"; - if (web_progress_notifier_ == NULL) { - TearDown(); - return E_FAIL; + if (ceee_module_util::GetOptionEnableWebProgressApis()) { + web_progress_notifier_.reset(CreateWebProgressNotifier()); + DCHECK(web_progress_notifier_ != NULL) + << "Failed to initialize WebProgressNotifier"; + if (web_progress_notifier_ == NULL) { + TearDown(); + return E_FAIL; + } } return S_OK; diff --git a/ceee/ie/plugin/bho/browser_helper_object_unittest.cc b/ceee/ie/plugin/bho/browser_helper_object_unittest.cc index aae41cc..0ce35d5 100644 --- a/ceee/ie/plugin/bho/browser_helper_object_unittest.cc +++ b/ceee/ie/plugin/bho/browser_helper_object_unittest.cc @@ -186,6 +186,8 @@ class BrowserHelperObjectTest: public testing::Test { StrictMock<testing::MockCeeeModuleUtils> ceee_module_utils; EXPECT_CALL(ceee_module_utils, GetOptionToolbandIsHidden()) .WillOnce(Return(false)); + EXPECT_CALL(ceee_module_utils, GetOptionEnableWebProgressApis()) + .WillRepeatedly(Return(false)); ASSERT_HRESULT_SUCCEEDED( TestingBrowserHelperObject::CreateInitialized(&bho_, &bho_with_site_)); bho_with_site_ = bho_; @@ -884,8 +886,10 @@ TEST_F(BrowserHelperObjectTest, SetToolBandSessionId) { TEST(BrowserHelperObjectLifeCycleTest, NoBhoForInvisibleToolband) { StrictMock<testing::MockCeeeModuleUtils> ceee_module_utils; - EXPECT_CALL(ceee_module_utils, GetOptionToolbandIsHidden()) - .WillOnce(Return(false)); + EXPECT_CALL(ceee_module_utils, GetOptionToolbandIsHidden()) + .WillOnce(Return(false)); + EXPECT_CALL(ceee_module_utils, GetOptionEnableWebProgressApis()) + .WillRepeatedly(Return(false)); TestingBrowserHelperObject* bho; base::win::ScopedComPtr<IObjectWithSite> bho_with_site; diff --git a/ceee/ie/plugin/bho/mediumtest_browser_helper_object.cc b/ceee/ie/plugin/bho/mediumtest_browser_helper_object.cc index e575933..38f984b 100644 --- a/ceee/ie/plugin/bho/mediumtest_browser_helper_object.cc +++ b/ceee/ie/plugin/bho/mediumtest_browser_helper_object.cc @@ -316,6 +316,8 @@ class BrowserHelperObjectTest: public ShellBrowserTestImpl<BrowserEventSink> { StrictMock<testing::MockCeeeModuleUtils> ceee_module_utils; EXPECT_CALL(ceee_module_utils, GetOptionToolbandIsHidden()) .WillRepeatedly(Return(false)); + EXPECT_CALL(ceee_module_utils, GetOptionEnableWebProgressApis()) + .WillRepeatedly(Return(false)); // Never torn down as other threads in the test may need it after // teardown. ScriptHost::set_default_debug_application(&debug_app); |