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

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

Issue 5610005: Makes instant run before unload listeners. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome
Patch Set: Addresses review comments 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
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 f8f93a423bdafc992913a07c4f16c42a53e70a4f..c49c645380c237f45b77c93ba71d14174c6f93c8 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -841,6 +841,12 @@ void TabContents::HideContents() {
WasHidden();
}
+bool TabContents::NeedToFireBeforeUnload() {
+ return notify_disconnection() &&
+ !showing_interstitial_page() &&
+ !render_view_host()->SuddenTerminationAllowed();
+}
+
void TabContents::OpenURL(const GURL& url, const GURL& referrer,
WindowOpenDisposition disposition,
PageTransition::Type transition) {
@@ -2795,6 +2801,8 @@ void TabContents::RunJavaScriptMessage(
void TabContents::RunBeforeUnloadConfirm(const std::wstring& message,
IPC::Message* reply_msg) {
+ if (delegate())
+ delegate()->WillRunBeforeUnloadConfirm();
if (delegate() && delegate()->ShouldSuppressDialogs()) {
render_view_host()->JavaScriptMessageBoxClosed(reply_msg, true,
std::wstring());

Powered by Google App Engine
This is Rietveld 408576698