diff --git a/browser/components/sidebar/src/Makefile.in b/browser/components/sidebar/src/Makefile.in index 989239b402040..5aaf21f273817 100644 --- a/browser/components/sidebar/src/Makefile.in +++ b/browser/components/sidebar/src/Makefile.in @@ -42,7 +42,7 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk -EXTRA_COMPONENTS = nsSidebar.js +EXTRA_PP_COMPONENTS = nsSidebar.js include $(topsrcdir)/config/rules.mk diff --git a/browser/components/sidebar/src/nsSidebar.js b/browser/components/sidebar/src/nsSidebar.js index 424e78c114460..0f4ed69eacc84 100644 --- a/browser/components/sidebar/src/nsSidebar.js +++ b/browser/components/sidebar/src/nsSidebar.js @@ -121,18 +121,30 @@ function (aTitle, aContentURL, aCustomizeURL, aPersist) if (!sidebarURLSecurityCheck(aContentURL)) return; +#ifdef MOZ_PLACES_BOOKMARKS + var uri = null; + var ioService = Components.classes["@mozilla.org/network/io-service;1"] + .getService(Components.interfaces.nsIIOService); + try { + uri = ioService.newURI(aContentURL, null, null); + } + catch(ex) { return; } + + win.PlacesUtils.showAddBookmarkUI(uri, aTitle, null, true, true); +#else var dialogArgs = { name: aTitle, url: aContentURL, bWebPanel: true } - var features; - if (!/Mac/.test(win.navigator.platform)) - features = "centerscreen,chrome,dialog,resizable,dependent"; - else - features = "chrome,dialog,resizable,modal"; +#ifdef XP_MACOSX + var features = "chrome,dialog,resizable,modal"; +#else + var features = "centerscreen,chrome,dialog,resizable,dependent"; +#endif win.openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", features, dialogArgs); +#endif } nsSidebar.prototype.validateSearchEngine =