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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2906133004: JavaScript dialogs cause a page to lose fullscreen. (Closed)
Patch Set: with a test Created 3 years, 6 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: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index ffba46b099c9192c32330841cccdb96e87b58595..edbbe2913f4f67b41a4516d232160cc97ce387a2 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4425,6 +4425,11 @@ void WebContentsImpl::RunJavaScriptDialog(RenderFrameHost* render_frame_host,
const GURL& frame_url,
JavaScriptDialogType dialog_type,
IPC::Message* reply_msg) {
+ // Running a dialog causes an exit to webpage-initiated fullscreen.
+ // http://crbug.com/728276
+ if (IsFullscreenForCurrentTab())
+ ExitFullscreen(false);
Matt Giuca 2017/06/09 06:16:37 I think this should be true... documentation says
Avi (use Gerrit) 2017/06/09 14:36:23 Done.
+
// Suppress JavaScript dialogs when requested. Also suppress messages when
// showing an interstitial as it's shown over the previous page and we don't
// want the hidden page's dialogs to interfere with the interstitial.
@@ -4457,6 +4462,11 @@ void WebContentsImpl::RunBeforeUnloadConfirm(
RenderFrameHost* render_frame_host,
bool is_reload,
IPC::Message* reply_msg) {
+ // Running a dialog causes an exit to webpage-initiated fullscreen.
+ // http://crbug.com/728276
+ if (IsFullscreenForCurrentTab())
+ ExitFullscreen(false);
Matt Giuca 2017/06/09 06:16:37 Same as above.
Avi (use Gerrit) 2017/06/09 14:36:23 Done.
+
RenderFrameHostImpl* rfhi =
static_cast<RenderFrameHostImpl*>(render_frame_host);
if (delegate_)

Powered by Google App Engine
This is Rietveld 408576698