Commit 235e2323 authored by Anastasiia Nikolaienko's avatar Anastasiia Nikolaienko Committed by Commit Bot

Don't open Settings during shutdown

OnDialogClosed is also called during shutdown. Opening Settings at this
point leads to a crash. Check that Chrome is not attempting shutdown
before opening the window.

Bug: 1018658
Change-Id: I99997e8d6cc7e83d3f8f1ad3be3b6c72b3c3c8c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1903365Reviewed-by: default avatarKush Sinha <sinhak@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Anastasiia Nikolaienko <anastasiian@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714428}
parent a36853bf
......@@ -7,6 +7,7 @@
#include <string>
#include "base/logging.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/settings_window_manager_chromeos.h"
......@@ -73,8 +74,11 @@ void AccountManagerWelcomeDialog::AdjustWidgetInitParams(
void AccountManagerWelcomeDialog::OnDialogClosed(
const std::string& json_retval) {
chrome::SettingsWindowManager::GetInstance()->ShowOSSettings(
ProfileManager::GetActiveUserProfile(), chrome::kAccountManagerSubPage);
// Opening Settings during shutdown leads to a crash.
if (!chrome::IsAttemptingShutdown()) {
chrome::SettingsWindowManager::GetInstance()->ShowOSSettings(
ProfileManager::GetActiveUserProfile(), chrome::kAccountManagerSubPage);
}
SystemWebDialogDelegate::OnDialogClosed(json_retval);
}
......
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