summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_active_document.cc
diff options
context:
space:
mode:
authorstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-15 17:01:34 +0000
committerstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-15 17:01:34 +0000
commit355309ef82ca45867d9e837a935514e3ca4c0f31 (patch)
tree6083d602e4fdfcd8f7aeb7ff92520f82311493b1 /chrome_frame/chrome_active_document.cc
parent9d1c829b4bccfcd730f735db9a10f51848ac4396 (diff)
downloadchromium_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/chrome_active_document.cc')
-rw-r--r--chrome_frame/chrome_active_document.cc31
1 files changed, 28 insertions, 3 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,