author | Josh Matthews <josh@joshmatthews.net> |
Thu, 22 Nov 2012 10:48:13 -0500 | |
changeset 114309 | c8766443985c6c82b3f35253bad3fb0a8d55dbfd |
parent 114308 | ae5e741238ccf7679ad78411dbe183b53af51523 |
child 114310 | d9634ee8c1cc2aeedecef274a4d3d36585da886d |
push id | 23913 |
push user | emorley@mozilla.com |
push date | Wed, 28 Nov 2012 17:11:31 +0000 |
treeherder | mozilla-central@17c267a881cf [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | bz |
bugs | 814275 |
milestone | 20.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
embedding/components/windowwatcher/src/nsWindowWatcher.cpp | file | annotate | diff | comparison | revisions |
--- a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp +++ b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp @@ -56,16 +56,20 @@ #include "nsIPresShell.h" #include "nsPresContext.h" #include "nsContentUtils.h" #include "nsIPrefBranch.h" #include "nsIPrefService.h" #include "nsSandboxFlags.h" #include "mozilla/Preferences.h" +#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING +#include "nsIPrivateBrowsingService.h" +#endif + #ifdef USEWEAKREFS #include "nsIWeakReference.h" #endif using namespace mozilla; static const char *sJSStackContractID="@mozilla.org/js/xpc/ContextStack;1"; @@ -899,16 +903,27 @@ nsWindowWatcher::OpenWindowInternal(nsID } if (windowIsNew) { // See if the caller has requested a private browsing window, or if all // windows should be private. bool isPrivateBrowsingWindow = Preferences::GetBool("browser.privatebrowsing.autostart") || !!(chromeFlags & nsIWebBrowserChrome::CHROME_PRIVATE_WINDOW); + +#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING + nsCOMPtr<nsIPrivateBrowsingService> pbs = + do_GetService(NS_PRIVATE_BROWSING_SERVICE_CONTRACTID); + if (pbs) { + bool inPrivateBrowsing = false; + pbs->GetPrivateBrowsingEnabled(&inPrivateBrowsing); + isPrivateBrowsingWindow |= inPrivateBrowsing; + } +#endif + // Otherwise, propagate the privacy status of the parent window, if // available, to the child. if (!isPrivateBrowsingWindow) { nsCOMPtr<nsIDocShellTreeItem> parentItem; GetWindowTreeItem(aParent, getter_AddRefs(parentItem)); nsCOMPtr<nsILoadContext> parentContext = do_QueryInterface(parentItem); if (parentContext) { isPrivateBrowsingWindow = parentContext->UsePrivateBrowsing();