Skip to content

Commit

Permalink
Bug 1814889: Ensure that opening private windows continues to display…
Browse files Browse the repository at this point in the history
… a private browsing icon on the Windows taskbar. r=bhearsum,mstange

Differential Revision: https://phabricator.services.mozilla.com/D168821
  • Loading branch information
Stephen A Pohl committed Feb 3, 2023
1 parent 7cf616d commit c28258d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions xpfe/appshell/nsAppShellService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,22 +671,21 @@ nsresult nsAppShellService::JustCreateTopWindow(

widgetInitData.mRTL = LocaleService::GetInstance()->IsAppLocaleRTL();

nsresult rv =
window->Initialize(parent, center ? aParent : nullptr, aInitialWidth,
aInitialHeight, aIsHiddenWindow, widgetInitData);

NS_ENSURE_SUCCESS(rv, rv);

// Enforce the Private Browsing autoStart pref first.
bool isPrivateBrowsingWindow =
StaticPrefs::browser_privatebrowsing_autostart();

if (aChromeMask & nsIWebBrowserChrome::CHROME_PRIVATE_WINDOW) {
// Caller requested a private window
isPrivateBrowsingWindow = true;
}
widgetInitData.mIsPrivate = isPrivateBrowsingWindow;

nsresult rv =
window->Initialize(parent, center ? aParent : nullptr, aInitialWidth,
aInitialHeight, aIsHiddenWindow, widgetInitData);

NS_ENSURE_SUCCESS(rv, rv);

nsCOMPtr<mozIDOMWindowProxy> domWin = do_GetInterface(aParent);
nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(domWin);
nsCOMPtr<nsILoadContext> parentContext = do_QueryInterface(webNav);
Expand Down

0 comments on commit c28258d

Please sign in to comment.