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..3aab619ff9329469d8e8961bbc9e56591128cb9f 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(true); |
+ |
// 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(true); |
+ |
RenderFrameHostImpl* rfhi = |
static_cast<RenderFrameHostImpl*>(render_frame_host); |
if (delegate_) |