Commit 753fc204 authored by Evan Stade's avatar Evan Stade Committed by Commit Bot

Revert "Speculative fix for app modal dialog crash"

This reverts commit f4332f96.

Reason for revert: broke dialogs during tab reparenting,
see crbug.com/1103617

Original change's description:
> Speculative fix for app modal dialog crash
> 
> Cancel JS dialogs when a WebContents's delegate is set to null, as the
> dialog can't show without a WebContentsDelegate.
> 
> Bug: 1060986
> Change-Id: I5272faa23d5461fc8251887d9bc02f03c54e37e3
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2283388
> Reviewed-by: Avi Drissman <avi@chromium.org>
> Commit-Queue: Evan Stade <estade@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#785954}

TBR=avi@chromium.org,estade@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1060986
Change-Id: Icab13a52cde868b8a9339d1bb1e585a1ab9aa24b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2293477Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#787795}
parent 8565d697
......@@ -1092,11 +1092,6 @@ void WebContentsImpl::SetDelegate(WebContentsDelegate* delegate) {
return;
if (delegate_)
delegate_->Detach(this);
CancelActiveAndPendingDialogs();
// Since |dialog_manager_| was provided by |delegate_|, reset it.
dialog_manager_ = nullptr;
delegate_ = delegate;
if (delegate_) {
delegate_->Attach(this);
......@@ -1174,8 +1169,9 @@ RenderViewHostImpl* WebContentsImpl::GetRenderViewHost() {
}
void WebContentsImpl::CancelActiveAndPendingDialogs() {
if (dialog_manager_)
if (dialog_manager_) {
dialog_manager_->CancelDialogs(this, /*reset_state=*/false);
}
if (browser_plugin_embedder_)
browser_plugin_embedder_->CancelGuestDialogs();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment