Commit f7e423bf authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Make sure to unblock a WebContents during a mass dialog closure.

BUG=880210

Change-Id: I44e80bc0866fef5370936db3f2cb4d3eacf620f2
Reviewed-on: https://chromium-review.googlesource.com/1241094Reviewed-by: default avatarLeonard Grey <lgrey@chromium.org>
Reviewed-by: default avatarMike Wittman <wittman@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594135}
parent f482cf79
......@@ -106,6 +106,10 @@ WebContentsModalDialogManager::DialogState::~DialogState() = default;
// then set the block state. Advantage: could restrict some of the
// WCMDM delegate methods, then, and pass them behind the scenes.
void WebContentsModalDialogManager::BlockWebContentsInteraction(bool blocked) {
if (blocked == web_contents_is_blocked_)
return;
web_contents_is_blocked_ = blocked;
WebContents* contents = web_contents();
if (!contents) {
// The WebContents has already disconnected.
......@@ -124,6 +128,7 @@ void WebContentsModalDialogManager::CloseAllDialogs() {
while (!child_dialogs_.empty()) {
child_dialogs_.front().manager->Close();
}
BlockWebContentsInteraction(false);
closing_all_dialogs_ = false;
}
......
......@@ -109,6 +109,9 @@ class WebContentsModalDialogManager
// True while closing the dialogs on WebContents close.
bool closing_all_dialogs_;
// True if the WebContents is blocked.
bool web_contents_is_blocked_ = false;
DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogManager);
};
......
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