Bug 823580 - Remove PlacesUIUtils.privateBrowsing usages in per-window PB builds; r=jdm

--HG--
extra : rebase_source : 4b6e55e3da4f57411cf2c3b996adad16ab22d228
This commit is contained in:
Ehsan Akhgari 2012-12-20 12:41:52 -05:00
parent 86c7e3b40a
commit 4b6a95ed1e
4 changed files with 13 additions and 4 deletions

View File

@ -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);

View File

@ -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

View File

@ -15,7 +15,7 @@ EXTRA_COMPONENTS = \
PlacesProtocolHandler.js \
$(NULL)
EXTRA_JS_MODULES = \
EXTRA_PP_JS_MODULES = \
PlacesUIUtils.jsm \
$(NULL)

View File

@ -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",