Bug 798965 - Avoid using gPrivateBrowsingUI.privateBrowsingEnabled in browser.js and use the per-window PB API instead; r=jdm

This commit is contained in:
Ehsan Akhgari 2012-10-07 17:47:10 -04:00
parent 0d95057a75
commit c5ed2d6c2e

View File

@ -521,7 +521,7 @@ var gPopupBlockerObserver = {
blockedPopupAllowSite.setAttribute("hidden", "true");
}
if (gPrivateBrowsingUI.privateBrowsingEnabled)
if (PrivateBrowsingUtils.isWindowPrivate(window))
blockedPopupAllowSite.setAttribute("disabled", "true");
else
blockedPopupAllowSite.removeAttribute("disabled");
@ -2064,7 +2064,7 @@ var gLastOpenDirectory = {
this._lastDir = val.clone();
// Don't save the last open directory pref inside the Private Browsing mode
if (!gPrivateBrowsingUI.privateBrowsingEnabled)
if (!PrivateBrowsingUtils.isWindowPrivate(window))
gPrefService.setComplexValue("browser.open.lastDir", Ci.nsILocalFile,
this._lastDir);
},
@ -3235,7 +3235,7 @@ const DOMLinkHandler = {
if (type == "application/opensearchdescription+xml" && link.title &&
/^(?:https?|ftp):/i.test(link.href) &&
!gPrivateBrowsingUI.privateBrowsingEnabled) {
!PrivateBrowsingUtils.isWindowPrivate(window)) {
var engine = { title: link.title, href: link.href };
BrowserSearch.addEngine(engine, link.ownerDocument);
searchAdded = true;