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; ...@@ -106,6 +106,10 @@ WebContentsModalDialogManager::DialogState::~DialogState() = default;
// then set the block state. Advantage: could restrict some of the // then set the block state. Advantage: could restrict some of the
// WCMDM delegate methods, then, and pass them behind the scenes. // WCMDM delegate methods, then, and pass them behind the scenes.
void WebContentsModalDialogManager::BlockWebContentsInteraction(bool blocked) { void WebContentsModalDialogManager::BlockWebContentsInteraction(bool blocked) {
if (blocked == web_contents_is_blocked_)
return;
web_contents_is_blocked_ = blocked;
WebContents* contents = web_contents(); WebContents* contents = web_contents();
if (!contents) { if (!contents) {
// The WebContents has already disconnected. // The WebContents has already disconnected.
...@@ -124,6 +128,7 @@ void WebContentsModalDialogManager::CloseAllDialogs() { ...@@ -124,6 +128,7 @@ void WebContentsModalDialogManager::CloseAllDialogs() {
while (!child_dialogs_.empty()) { while (!child_dialogs_.empty()) {
child_dialogs_.front().manager->Close(); child_dialogs_.front().manager->Close();
} }
BlockWebContentsInteraction(false);
closing_all_dialogs_ = false; closing_all_dialogs_ = false;
} }
......
...@@ -109,6 +109,9 @@ class WebContentsModalDialogManager ...@@ -109,6 +109,9 @@ class WebContentsModalDialogManager
// True while closing the dialogs on WebContents close. // True while closing the dialogs on WebContents close.
bool closing_all_dialogs_; bool closing_all_dialogs_;
// True if the WebContents is blocked.
bool web_contents_is_blocked_ = false;
DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogManager); 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