diff options
author | stoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-15 17:01:34 +0000 |
---|---|---|
committer | stoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-15 17:01:34 +0000 |
commit | 355309ef82ca45867d9e837a935514e3ca4c0f31 (patch) | |
tree | 6083d602e4fdfcd8f7aeb7ff92520f82311493b1 /chrome_frame | |
parent | 9d1c829b4bccfcd730f735db9a10f51848ac4396 (diff) | |
download | chromium_src-355309ef82ca45867d9e837a935514e3ca4c0f31.zip chromium_src-355309ef82ca45867d9e837a935514e3ca4c0f31.tar.gz chromium_src-355309ef82ca45867d9e837a935514e3ca4c0f31.tar.bz2 |
More integration with host (InternetExplorer) popup blocker.
BUG=34823
Review URL: http://codereview.chromium.org/907005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41595 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/chrome_active_document.cc | 31 | ||||
-rw-r--r-- | chrome_frame/chrome_active_document.h | 8 |
2 files changed, 35 insertions, 4 deletions
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc index 08efdd2..4950ae8 100644 --- a/chrome_frame/chrome_active_document.cc +++ b/chrome_frame/chrome_active_document.cc @@ -53,6 +53,7 @@ bool g_first_launch_by_process_ = true; ChromeActiveDocument::ChromeActiveDocument() : first_navigation_(true), is_automation_client_reused_(false), + popup_allowed_(false), accelerator_table_(NULL) { url_fetcher_.set_frame_busting(false); memset(&navigation_info_, 0, sizeof(navigation_info_)); @@ -737,12 +738,14 @@ void ChromeActiveDocument::OnAttachExternalTab(int tab_handle, DWORD flags = 0; if (params.user_gesture) flags = NWMF_USERREQUESTED; + else if (popup_allowed_) + flags = NWMF_USERALLOWED; HRESULT hr = S_OK; if (popup_manager_) { - hr = popup_manager_->EvaluateNewWindow( - UTF8ToWide(params.url.spec()).c_str(), NULL, url_, NULL, FALSE, flags, - 0); + LPCWSTR popup_wnd_url = UTF8ToWide(params.url.spec()).c_str(); + hr = popup_manager_->EvaluateNewWindow(popup_wnd_url, NULL, url_, + NULL, FALSE, flags, 0); } // Allow popup if (hr == S_OK) { @@ -958,6 +961,28 @@ bool ChromeActiveDocument::LaunchUrl(const std::wstring& url, return false; } + +HRESULT ChromeActiveDocument::OnRefreshPage(const GUID* cmd_group_guid, + DWORD command_id, DWORD cmd_exec_opt, VARIANT* in_args, VARIANT* out_args) { + popup_allowed_ = false; + if (in_args->vt == VT_I4 && + in_args->lVal & OLECMDIDF_REFRESH_PAGEACTION_POPUPWINDOW) { + popup_allowed_ = true; + + // Ask the yellow security band to change the text and icon and to remain + // visible. + IEExec(&CGID_DocHostCommandHandler, OLECMDID_PAGEACTIONBLOCKED, + 0x80000000 | OLECMDIDF_WINDOWSTATE_USERVISIBLE_VALID, NULL, NULL); + } + + TabProxy* tab_proxy = GetTabProxy(); + if (tab_proxy) + tab_proxy->ReloadAsync(); + + return S_OK; +} + + HRESULT ChromeActiveDocument::SetPageFontSize(const GUID* cmd_group_guid, DWORD command_id, DWORD cmd_exec_opt, diff --git a/chrome_frame/chrome_active_document.h b/chrome_frame/chrome_active_document.h index 68c5c45..2e8840c 100644 --- a/chrome_frame/chrome_active_document.h +++ b/chrome_frame/chrome_active_document.h @@ -167,9 +167,9 @@ BEGIN_EXEC_COMMAND_MAP(ChromeActiveDocument) FORWARD_TAB_COMMAND(NULL, OLECMDID_CUT, Cut) FORWARD_TAB_COMMAND(NULL, OLECMDID_COPY, Copy) FORWARD_TAB_COMMAND(NULL, OLECMDID_PASTE, Paste) - FORWARD_TAB_COMMAND(NULL, OLECMDID_REFRESH, ReloadAsync) FORWARD_TAB_COMMAND(NULL, OLECMDID_STOP, StopAsync) FORWARD_TAB_COMMAND(NULL, OLECMDID_SAVEAS, SaveAsAsync) + EXEC_COMMAND_HANDLER(NULL, OLECMDID_REFRESH, OnRefreshPage) EXEC_COMMAND_HANDLER(&CGID_Explorer, SBCMDID_MIXEDZONE, OnDetermineSecurityZone) EXEC_COMMAND_HANDLER(&CGID_MSHTML, IDM_BASELINEFONT1, SetPageFontSize) @@ -299,6 +299,11 @@ END_EXEC_COMMAND_MAP() VARIANT* in_args, VARIANT* out_args); + // IOleCommandTarget handler for page refresh command + HRESULT OnRefreshPage(const GUID* cmd_group_guid, DWORD command_id, + DWORD cmd_exec_opt, VARIANT* in_args, VARIANT* out_args); + + // Get the travel log from the client site HRESULT GetBrowserServiceAndTravelLog(IBrowserService** browser_service, ITravelLog** travel_log); @@ -331,6 +336,7 @@ END_EXEC_COMMAND_MAP() ScopedComPtr<IInternetSecurityManager> security_manager_; ScopedComPtr<INewWindowManager> popup_manager_; + bool popup_allowed_; HACCEL accelerator_table_; public: |