diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-12 17:01:27 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-12 17:01:27 +0000 |
commit | b98a1b6cc056e6f78737a1c587eb179b064b4789 (patch) | |
tree | 61c01689f22898f0cc69a28b359de0e17195b7aa /chrome/browser/web_contents.cc | |
parent | 8240fca6ad234d1dce76986084aeac9fffd4f1be (diff) | |
download | chromium_src-b98a1b6cc056e6f78737a1c587eb179b064b4789.zip chromium_src-b98a1b6cc056e6f78737a1c587eb179b064b4789.tar.gz chromium_src-b98a1b6cc056e6f78737a1c587eb179b064b4789.tar.bz2 |
Prevent constrained popup windows from trying to become real
windows by using alert().
B=1372216
Review URL: http://codereview.chromium.org/1970
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2116 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/web_contents.cc')
-rw-r--r-- | chrome/browser/web_contents.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/web_contents.cc b/chrome/browser/web_contents.cc index a1eced4..0893681 100644 --- a/chrome/browser/web_contents.cc +++ b/chrome/browser/web_contents.cc @@ -1902,7 +1902,14 @@ void WebContents::RunJavaScriptMessage( const std::wstring& default_prompt, const int flags, IPC::Message* reply_msg) { - if (!suppress_javascript_messages_) { + // Suppress javascript messages when requested and when inside a constrained + // popup window (because that activates them and breaks them out of the + // constrained window jail). + bool suppress_this_message = suppress_javascript_messages_; + if (delegate()) + suppress_this_message |= delegate()->IsPopup(this); + + if (!suppress_this_message) { TimeDelta time_since_last_message( TimeTicks::Now() - last_javascript_message_dismissal_); bool show_suppress_checkbox = false; @@ -2589,4 +2596,3 @@ BOOL WebContents::EnumPluginWindowsCallback(HWND window, LPARAM) { return TRUE; } - |