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(); |