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

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: Better 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 54e62d2877987c524ecc9d41cd0ea71fdec877f9..814f6e35d78af50a3273acf3e3dcf02ecb01f954 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -840,6 +840,12 @@ void TabContents::HideContents() {
WasHidden();
}
+bool TabContents::NeedToFireBeforeUnload() {
+ return notify_disconnection() &&
+ !showing_interstitial_page() &&
Charlie Reis 2010/12/08 01:26:12 Why is this line necessary? I think we run unload
sky 2010/12/08 03:04:22 No idea there. This code comes directly from Brows
Charlie Reis 2010/12/08 05:50:11 Oh! Well, it doesn't sound right to me, since the
+ !render_view_host()->SuddenTerminationAllowed();
Charlie Reis 2010/12/08 01:26:12 Doesn't this catch both the beforeunload and unloa
sky 2010/12/08 03:04:22 Yes.
Charlie Reis 2010/12/08 05:50:11 Yep, the improved comment is enough-- thanks.
+}
+
void TabContents::OpenURL(const GURL& url, const GURL& referrer,
WindowOpenDisposition disposition,
PageTransition::Type transition) {
@@ -2785,6 +2791,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