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

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

Issue 5631001: Stops javascript alerts and unload dialogs from showing during (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move to single method Created 10 years 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
« no previous file with comments | « chrome/browser/instant/instant_loader.cc ('k') | chrome/browser/tab_contents/tab_contents_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents.cc
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 7fa1f9a455a2484d0415ca1ee30765876987c376..6637a1aba6bb9497b91a4fb30d75ea6099a90ac2 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -2754,8 +2754,10 @@ 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.
- bool suppress_this_message = suppress_javascript_messages_ ||
- showing_interstitial_page();
+ bool suppress_this_message =
+ suppress_javascript_messages_ ||
+ showing_interstitial_page() ||
+ (delegate() && delegate()->ShouldSuppressDialogs());
if (delegate())
suppress_this_message |=
(delegate()->GetConstrainingContents(this) != this);
@@ -2783,6 +2785,11 @@ void TabContents::RunJavaScriptMessage(
void TabContents::RunBeforeUnloadConfirm(const std::wstring& message,
IPC::Message* reply_msg) {
+ if (delegate() && delegate()->ShouldSuppressDialogs()) {
+ render_view_host()->JavaScriptMessageBoxClosed(reply_msg, true,
+ std::wstring());
+ return;
+ }
is_showing_before_unload_dialog_ = true;
RunBeforeUnloadDialog(this, message, reply_msg);
}
« no previous file with comments | « chrome/browser/instant/instant_loader.cc ('k') | chrome/browser/tab_contents/tab_contents_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698