Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7295)

Unified Diff: content/browser/tab_contents/tab_contents.cc

Issue 6627063: Ignore JavaScript messages (alert/confirm/prompt) during unload handlers. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/tab_contents/tab_contents.cc
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 99bba05763bd6bd653dfb49e6b74ddcda356ee1e..87070e8e98cc1415556799e4802899681b984c5a 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -2425,6 +2425,7 @@ void TabContents::RunJavaScriptMessage(
const std::wstring& default_prompt,
const GURL& frame_url,
const int flags,
+ const bool unload_handler_being_run,
IPC::Message* reply_msg,
bool* did_suppress_message) {
// Suppress javascript messages when requested and when inside a constrained
@@ -2433,9 +2434,11 @@ void TabContents::RunJavaScriptMessage(
// Also suppress messages when showing an interstitial. The interstitial is
// shown over the previous page, we don't want the hidden page dialogs to
// interfere with the interstitial.
+ // Also suppress messages during beforeunload/unload event handlers.
bool suppress_this_message =
suppress_javascript_messages_ ||
showing_interstitial_page() ||
+ unload_handler_being_run ||
(delegate() && delegate()->ShouldSuppressDialogs());
if (delegate())
suppress_this_message |=
« chrome/renderer/render_view.cc ('K') | « content/browser/tab_contents/tab_contents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698