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

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

Issue 2194243002: Suppress JavaScript dialogs when a tab puts itself into fullscreen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: switch fullscreen call Created 4 years, 4 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 | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/fast_unload_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 39519544c8df67a06252595604997d394b10d618..32c9ddd2673877e188fc50b7efc58c1d2e91652c 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1206,6 +1206,16 @@ bool Browser::CanOverscrollContent() const {
return true;
}
+bool Browser::ShouldSuppressDialogs(WebContents* source, bool before_unload) {
+ if (before_unload)
+ return false;
+
+ // In the case where fullscreen was triggered by the web page ("tab
+ // fullscreen"), do not allow dialogs. This does not affect the case of user-
+ // initiated fullscreen ("browser fullscreen").
+ return exclusive_access_manager_->fullscreen_controller()->IsTabFullscreen();
+}
+
bool Browser::ShouldPreserveAbortedURLs(WebContents* source) {
// Allow failed URLs to stick around in the omnibox on the NTP, but not when
// other pages have committed.
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/fast_unload_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698