From 4b6a95ed1eba0dfdb707cc7922720ffa9aed9522 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Thu, 20 Dec 2012 12:41:52 -0500 Subject: [PATCH] Bug 823580 - Remove PlacesUIUtils.privateBrowsing usages in per-window PB builds; r=jdm --HG-- extra : rebase_source : 4b6e55e3da4f57411cf2c3b996adad16ab22d228 --- browser/components/places/content/controller.js | 11 +++++++++-- browser/components/places/jar.mn | 2 +- browser/components/places/src/Makefile.in | 2 +- browser/components/places/src/PlacesUIUtils.jsm | 2 ++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/browser/components/places/content/controller.js b/browser/components/places/content/controller.js index 6a4609ce861..32d9ca4511a 100644 --- a/browser/components/places/content/controller.js +++ b/browser/components/places/content/controller.js @@ -141,8 +141,11 @@ PlacesController.prototype = { case "placesCmd_delete": return this._hasRemovableSelection(false); case "placesCmd_deleteDataHost": - return this._hasRemovableSelection(false) && - !PlacesUIUtils.privateBrowsing.privateBrowsingEnabled; + return this._hasRemovableSelection(false) +#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING + && !PlacesUIUtils.privateBrowsing.privateBrowsingEnabled +#endif + ; case "placesCmd_moveBookmarks": return this._hasRemovableSelection(true); case "cmd_copy": @@ -601,8 +604,12 @@ PlacesController.prototype = { // We allow pasting into tag containers, so special case that. var hideIfNoIP = item.getAttribute("hideifnoinsertionpoint") == "true" && noIp && !(ip && ip.isTag && item.id == "placesContext_paste"); +#ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING + var hideIfPB = false; +#else var hideIfPB = item.getAttribute("hideifprivatebrowsing") == "true" && PlacesUIUtils.privateBrowsing.privateBrowsingEnabled; +#endif item.hidden = hideIfNoIP || hideIfPB || !this._shouldShowMenuItem(item, metadata); diff --git a/browser/components/places/jar.mn b/browser/components/places/jar.mn index e8ab80c5246..38942973805 100644 --- a/browser/components/places/jar.mn +++ b/browser/components/places/jar.mn @@ -15,7 +15,7 @@ browser.jar: content/browser/places/placesOverlay.xul (content/placesOverlay.xul) * content/browser/places/menu.xml (content/menu.xml) content/browser/places/tree.xml (content/tree.xml) - content/browser/places/controller.js (content/controller.js) +* content/browser/places/controller.js (content/controller.js) content/browser/places/treeView.js (content/treeView.js) * content/browser/places/browserPlacesViews.js (content/browserPlacesViews.js) # keep the Places version of the history sidebar at history/history-panel.xul diff --git a/browser/components/places/src/Makefile.in b/browser/components/places/src/Makefile.in index 1d793a3943e..1a50c1d9a67 100644 --- a/browser/components/places/src/Makefile.in +++ b/browser/components/places/src/Makefile.in @@ -15,7 +15,7 @@ EXTRA_COMPONENTS = \ PlacesProtocolHandler.js \ $(NULL) -EXTRA_JS_MODULES = \ +EXTRA_PP_JS_MODULES = \ PlacesUIUtils.jsm \ $(NULL) diff --git a/browser/components/places/src/PlacesUIUtils.jsm b/browser/components/places/src/PlacesUIUtils.jsm index eb20c6ec77b..6c3f04f6c5c 100644 --- a/browser/components/places/src/PlacesUIUtils.jsm +++ b/browser/components/places/src/PlacesUIUtils.jsm @@ -1009,9 +1009,11 @@ XPCOMUtils.defineLazyGetter(PlacesUIUtils, "ellipsis", function() { Ci.nsIPrefLocalizedString).data; }); +#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING XPCOMUtils.defineLazyServiceGetter(PlacesUIUtils, "privateBrowsing", "@mozilla.org/privatebrowsing;1", "nsIPrivateBrowsingService"); +#endif XPCOMUtils.defineLazyServiceGetter(this, "URIFixup", "@mozilla.org/docshell/urifixup;1",