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); 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. * Adds a bookmark to the page loaded in the current tab.
*/ */
bookmarkCurrentPage: function PCH_bookmarkCurrentPage() { bookmarkCurrentPage: function PCH_bookmarkCurrentPage() {
var selectedBrowser = getBrowser().selectedBrowser; PlacesUtils.showAddBookmarkUI(getBrowser().selectedBrowser);
PlacesUtils.showAddBookmarkUI(selectedBrowser.currentURI);
}, },
/** /**
* This function returns a list of nsIURI objects characterizing the * This function returns a list of nsIURI objects characterizing the
* tabs currently open in the browser. The URIs will appear in the * tabs currently open in the browser. The URIs will appear in the

View File

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