Commit 34b81a26 authored by Jiewei Qian's avatar Jiewei Qian Committed by Chromium LUCI CQ

ash: use the right profile when checking for legacy OS Settings window

ChromeLauncherController may be created with a nullptr profile. In this
case, the profile is resolved to the current active profile.

SettingsWindowManager should wait for profile resolution before checking
if the profile uses legacy settings window.

Change-Id: Ia8c16f35387a6f328f611a8810e54118ac1a2b2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2567845Reviewed-by: default avatarcalamity <calamity@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Commit-Queue: Jiewei Qian  <qjw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834110}
parent c9b12498
......@@ -214,10 +214,6 @@ ChromeLauncherController::ChromeLauncherController(Profile* profile,
DCHECK(model_);
if (chrome::SettingsWindowManager::UseDeprecatedSettingsWindow(profile)) {
settings_window_observer_ = std::make_unique<SettingsWindowObserver>();
}
if (!profile) {
// If no profile was passed, we take the currently active profile and use it
// as the owner of the current desktop.
......@@ -229,6 +225,10 @@ ChromeLauncherController::ChromeLauncherController(Profile* profile,
profile = profile->GetOriginalProfile();
}
if (chrome::SettingsWindowManager::UseDeprecatedSettingsWindow(profile)) {
settings_window_observer_ = std::make_unique<SettingsWindowObserver>();
}
// All profile relevant settings get bound to the current profile.
AttachProfile(profile);
DCHECK_EQ(profile, profile_);
......
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