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

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

Issue 2906133004: JavaScript dialogs cause a page to lose fullscreen. (Closed)
Patch Set: beforeunload too Created 3 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.cc
diff --git a/chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.cc b/chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.cc
index 3c129ddf63df97801ae902bdb359207226d48ff3..881ffe2029fde5f4cd846aae81aabbdce35f7aae 100644
--- a/chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.cc
+++ b/chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.cc
@@ -133,6 +133,11 @@ void JavaScriptDialogTabHelper::RunJavaScriptDialog(
break;
}
+ // For security reasons, when a page requests a JavaScript dialog it forfeits
+ // fullscreen. http://crbug.com/670135
+ parent_web_contents->GetDelegate()->ExitFullscreenModeForTab(
+ parent_web_contents);
meacer 2017/06/01 22:26:01 Drive by: Does this exit window-fullscreen (as opp
Avi (use Gerrit) 2017/06/01 22:49:33 No, this is only exiting html5 fullscreen, which i
+
if (IsEnabled()) {
if (!IsWebContentsForemost(parent_web_contents) &&
dialog_type == content::JAVASCRIPT_DIALOG_TYPE_PROMPT) {
@@ -240,6 +245,10 @@ void JavaScriptDialogTabHelper::RunBeforeUnloadDialog(
double engagement_score =
site_engagement_service->GetScore(web_contents->GetLastCommittedURL());
+ // For security reasons, when a page requests a JavaScript dialog it forfeits
+ // fullscreen. http://crbug.com/670135
+ web_contents->GetDelegate()->ExitFullscreenModeForTab(web_contents);
+
return AppModalDialogManager()->RunBeforeUnloadDialog(
web_contents, is_reload,
base::Bind(&SaveUnloadUmaStats, engagement_score, callback));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698