Bug 1766636: set private window feature correctly for profile manager window, to ensure they use the correct windows taskbar icon r=mossop

Differential Revision: https://phabricator.services.mozilla.com/D152462
This commit is contained in:
Ben Hearsum 2022-08-08 15:59:38 +00:00
Родитель 622826bf1d
Коммит 5be6666af9
1 изменённых файлов: 16 добавлений и 4 удалений

Просмотреть файл

@ -2908,11 +2908,17 @@ static ReturnAbortOnError ShowProfileManager(
nsCOMPtr<nsIAppStartup> appStartup(components::AppStartup::Service());
NS_ENSURE_TRUE(appStartup, NS_ERROR_FAILURE);
nsAutoCString features("centerscreen,chrome,modal,titlebar");
// If we're launching a private browsing window make sure to set that
// feature for the Profile Manager window as well, so it groups correctly
// on the Windows taskbar.
if (CheckArgExists("private-window") == ARG_FOUND) {
features.AppendLiteral(",private");
}
nsCOMPtr<mozIDOMWindowProxy> newWindow;
rv = windowWatcher->OpenWindow(
nullptr, nsDependentCString(kProfileManagerURL), "_blank"_ns,
"centerscreen,chrome,modal,titlebar"_ns, ioParamBlock,
getter_AddRefs(newWindow));
features, ioParamBlock, getter_AddRefs(newWindow));
NS_ENSURE_SUCCESS_LOG(rv, rv);
@ -3331,11 +3337,17 @@ static ReturnAbortOnError CheckDowngrade(nsIFile* aProfileDir,
paramBlock->SetInt(0, flags);
nsAutoCString features("centerscreen,chrome,modal,titlebar");
// If we're launching a private browsing window make sure to set that
// feature for the Profile Manager window as well, so it groups correctly
// on the Windows taskbar.
if (CheckArgExists("private-window") == ARG_FOUND) {
features.AppendLiteral(",private");
}
nsCOMPtr<mozIDOMWindowProxy> newWindow;
rv = windowWatcher->OpenWindow(
nullptr, nsDependentCString(kProfileDowngradeURL), "_blank"_ns,
"centerscreen,chrome,modal,titlebar"_ns, paramBlock,
getter_AddRefs(newWindow));
features, paramBlock, getter_AddRefs(newWindow));
NS_ENSURE_SUCCESS(rv, rv);
paramBlock->GetInt(1, &result);