summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents/tab_contents.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-06 18:11:50 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-06 18:11:50 +0000
commit8f55e8087439851d78245881a8acd62b24251801 (patch)
tree5647921d79785873857b41601b8861bbb6f31c53 /chrome/browser/tab_contents/tab_contents.cc
parent2c1a82846a04cb8277d4ddf514f9e0ff122da0d1 (diff)
downloadchromium_src-8f55e8087439851d78245881a8acd62b24251801.zip
chromium_src-8f55e8087439851d78245881a8acd62b24251801.tar.gz
chromium_src-8f55e8087439851d78245881a8acd62b24251801.tar.bz2
Stops javascript alerts and unload dialogs from showing during
instant. BUG=65206 TEST=see bug Review URL: http://codereview.chromium.org/5631001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68354 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents/tab_contents.cc')
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 371e221..54e62d2 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);
}