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

Unified Diff: ui/views/controls/webview/web_dialog_view.cc

Issue 2783723002: Keep track in the browser of which frames have onunload and onbeforeunload handlers. (Closed)
Patch Set: fix content_browsertests with plznavigate and also remove now unnecessary unloadcontroller change Created 3 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: ui/views/controls/webview/web_dialog_view.cc
diff --git a/ui/views/controls/webview/web_dialog_view.cc b/ui/views/controls/webview/web_dialog_view.cc
index 81e1882f67fe0d694f37fa2c30a1c53b60a69f14..bb2871a8596eee16eef7a8889f3e315da15c4ef6 100644
--- a/ui/views/controls/webview/web_dialog_view.cc
+++ b/ui/views/controls/webview/web_dialog_view.cc
@@ -110,7 +110,8 @@ bool WebDialogView::CanClose() {
return true;
}
- if (!is_attempting_close_dialog_) {
+ if (!is_attempting_close_dialog_ &&
+ web_view_->web_contents()->NeedToFireBeforeUnload()) {
// Fire beforeunload event when user attempts to close the dialog.
is_attempting_close_dialog_ = true;
web_view_->web_contents()->DispatchBeforeUnload();

Powered by Google App Engine
This is Rietveld 408576698