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

Unified Diff: third_party/WebKit/Source/web/ChromeClientImpl.cpp

Issue 1778753003: Fire visibilitychange event on unload (behind the flag) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add dismissal type Created 4 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
« no previous file with comments | « third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/ChromeClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/ChromeClientImpl.cpp b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
index e2e82f9ed76e182a84314984d44107dee468829e..bbe850b0b3611aeaf3187c8f599dec3afd036df4 100644
--- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -864,7 +864,9 @@ bool ChromeClientImpl::shouldOpenModalDialogDuringPageDismissal(const DialogType
ASSERT_WITH_SECURITY_IMPLICATION(0 <= dialog);
ASSERT_WITH_SECURITY_IMPLICATION(dialog < static_cast<int>(WTF_ARRAY_LENGTH(kDialogs)));
- const char* const kDismissals[] = { "beforeunload", "pagehide", "unload" };
+ // This array must be consistent with PageDismissalType enum defined in
dcheng 2016/03/11 04:20:38 Do we need to preserve the relative order? This is
kinuko 2016/03/11 05:12:50 Hmm, true. I removed the UMA part & changed these
+ // Document.h.
+ const char* const kDismissals[] = { "beforeunload", "pagehide", "visibilitychange", "unload" };
int dismissal = static_cast<int>(dismissalType) - 1; // Exclude NoDismissal.
ASSERT_WITH_SECURITY_IMPLICATION(0 <= dismissal);
ASSERT_WITH_SECURITY_IMPLICATION(dismissal < static_cast<int>(WTF_ARRAY_LENGTH(kDismissals)));
« no previous file with comments | « third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698