Bug 367035 - No 'Bookmark This Tab' and 'Bookmark All Tabs' menuitms in the tabbar context menu (places-bookmarks builds). r=sspitzer.

This commit is contained in:
mozilla.mano%sent.com 2007-01-31 03:09:48 +00:00
parent c1fbb4c36a
commit f3cce4d2e4
2 changed files with 18 additions and 5 deletions

View File

@ -105,14 +105,24 @@ var PlacesCommandHook = {
PlacesUtils.showAddBookmarkUI(linkURI, title);
},
/**
* Adds a bookmark to the page loaded in the given browser
* @param aBrowser
* a <browser> element
*/
bookmarkPage: function PCH_bookmarkCurrentPage(aBrowser) {
var selectedBrowser = getBrowser().selectedBrowser;
PlacesUtils.showAddBookmarkUI(aBrowser.currentURI);
},
/**
* Adds a bookmark to the page loaded in the current tab.
*/
bookmarkCurrentPage: function PCH_bookmarkCurrentPage() {
var selectedBrowser = getBrowser().selectedBrowser;
PlacesUtils.showAddBookmarkUI(selectedBrowser.currentURI);
PlacesUtils.showAddBookmarkUI(getBrowser().selectedBrowser);
},
/**
* This function returns a list of nsIURI objects characterizing the
* tabs currently open in the browser. The URIs will appear in the

View File

@ -278,7 +278,6 @@ function SetClickAndHoldHandlers()
}
#endif
#ifndef MOZ_PLACES_BOOKMARKS
function addBookmarkMenuitems()
{
var tabbrowser = getBrowser();
@ -304,9 +303,12 @@ function BookmarkThisTab()
if (tab.localName != "tab")
tab = getBrowser().mCurrentTab;
#ifdef MOZ_PLACES_BOOKMARKS
PlacesCommandHook.bookmarkPage(tab.linkedBrowser);
#else
addBookmarkAs(tab.linkedBrowser, false);
}
#endif
}
const gSessionHistoryObserver = {
observe: function(subject, topic, data)
@ -989,9 +991,10 @@ function delayedStartup()
sidebar.setAttribute("src", sidebarBox.getAttribute("src"));
}
#ifndef MOZ_PLACES_BOOKMARKS
// add bookmark options to context menu for tabs
addBookmarkMenuitems();
#ifndef MOZ_PLACES_BOOKMARKS
initServices();
initBMService();
// now load bookmarks