Commit 881dfb5c authored by Kushagra Sinha's avatar Kushagra Sinha Committed by Commit Bot

Check for browser shutdown before launching crOS AccountManager

This is related to https://crrev.com/c/1903365 - with the additional
check that |g_browser_process| may be abnormally shutting down without
|chrome::IsAttemptingShutdown| being true - which happens only for a
clean, user attempted shutdown.

Bug: 1121894
Change-Id: I6d4aa7de8998ad0c621f0fc17a17853924cfd342
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2385437Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Commit-Queue: Kush Sinha <sinhak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803108}
parent 254e4092
......@@ -7,6 +7,7 @@
#include <string>
#include "base/check_op.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
......@@ -83,8 +84,9 @@ void AccountManagerWelcomeDialog::AdjustWidgetInitParams(
void AccountManagerWelcomeDialog::OnDialogClosed(
const std::string& json_retval) {
// Opening Settings during shutdown leads to a crash.
if (!chrome::IsAttemptingShutdown()) {
// Opening Settings during shutdown or crash/restart leads to a crash.
if (!chrome::IsAttemptingShutdown() && g_browser_process &&
!g_browser_process->IsShuttingDown()) {
chrome::SettingsWindowManager::GetInstance()->ShowOSSettings(
ProfileManager::GetActiveUserProfile(),
chromeos::settings::mojom::kMyAccountsSubpagePath);
......
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