Commit 0ff0ce07 authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Make SigninViewControllerDelegate unregister itself as modal dialog delegate.

BUG=771142
TEST=crashes go away

Change-Id: I6bb1c0986bc16aba253129c57db08eaefc4cc83a
Reviewed-on: https://chromium-review.googlesource.com/698666Reviewed-by: default avatarMike Wittman <wittman@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506576}
parent f8a0c12d
...@@ -38,7 +38,11 @@ SigninViewControllerDelegate::SigninViewControllerDelegate( ...@@ -38,7 +38,11 @@ SigninViewControllerDelegate::SigninViewControllerDelegate(
web_contents_->SetDelegate(this); web_contents_->SetDelegate(this);
} }
SigninViewControllerDelegate::~SigninViewControllerDelegate() {} SigninViewControllerDelegate::~SigninViewControllerDelegate() {
web_modal::WebContentsModalDialogManager* manager =
web_modal::WebContentsModalDialogManager::FromWebContents(web_contents_);
manager->SetDelegate(nullptr);
}
void SigninViewControllerDelegate::AttachDialogManager() { void SigninViewControllerDelegate::AttachDialogManager() {
web_modal::WebContentsModalDialogManager::CreateForWebContents(web_contents_); web_modal::WebContentsModalDialogManager::CreateForWebContents(web_contents_);
......
...@@ -77,9 +77,9 @@ void WebContentsModalDialogManager::WillClose(gfx::NativeWindow dialog) { ...@@ -77,9 +77,9 @@ void WebContentsModalDialogManager::WillClose(gfx::NativeWindow dialog) {
bool removed_topmost_dialog = dlg == child_dialogs_.begin(); bool removed_topmost_dialog = dlg == child_dialogs_.begin();
child_dialogs_.erase(dlg); child_dialogs_.erase(dlg);
if (delegate_ && delegate_->IsWebContentsVisible(web_contents()) && if (!closing_all_dialogs_ &&
!child_dialogs_.empty() && removed_topmost_dialog && (!child_dialogs_.empty() && removed_topmost_dialog) &&
!closing_all_dialogs_) { (delegate_ && delegate_->IsWebContentsVisible(web_contents()))) {
child_dialogs_.front().manager->Show(); child_dialogs_.front().manager->Show();
} }
......
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