327500 - clean up remaining uses of old bookmarks fe into ifndef MOZ_PLACES. fix build orange and other issues. r=annie.sullivan@gmail.com

This commit is contained in:
beng%bengoodger.com 2006-02-16 19:00:25 +00:00
parent c1b55e69ba
commit 98724fe39b
2 changed files with 45 additions and 11 deletions

View File

@ -832,8 +832,8 @@ function delayedStartup()
gURLBar.addEventListener("dragdrop", URLBarOnDrop, true);
// loads the services
initServices();
#ifndef MOZ_PLACES
initServices();
initBMService();
#endif
gBrowser.addEventListener("pageshow", function(evt) { setTimeout(pageShowEventHandlers, 0, evt); }, true);
@ -850,8 +850,8 @@ function delayedStartup()
// add bookmark options to context menu for tabs
addBookmarkMenuitems();
// now load bookmarks
#ifndef MOZ_PLACES
// now load bookmarks
BMSVC.readBookmarks();
var bt = document.getElementById("bookmarks-ptf");
if (bt) {
@ -860,15 +860,13 @@ function delayedStartup()
document.getElementById("bookmarks-chevron").ref = btf;
bt.database.AddObserver(BookmarksToolbarRDFObserver);
}
window.addEventListener("resize", BookmarksToolbar.resizeFunc, false);
document.getElementById("PersonalToolbar")
.controllers.appendController(BookmarksMenuController);
#else
var bookmarksBar = document.getElementById("bookmarksBarContent");
bookmarksBar.init();
#endif
window.addEventListener("resize", BookmarksToolbar.resizeFunc, false);
#ifndef MOZ_PLACES
document.getElementById("PersonalToolbar")
.controllers.appendController(BookmarksMenuController);
#endif
// called when we go into full screen, even if it is
// initiated by a web page script
@ -984,6 +982,7 @@ function BrowserShutdown()
} catch (ex) {
}
#ifndef MOZ_PLACES
try {
document.getElementById("PersonalToolbar")
.controllers.removeController(BookmarksMenuController);
@ -997,6 +996,7 @@ function BrowserShutdown()
} catch (ex) {
}
}
#endif
try {
var pbi = gPrefService.QueryInterface(Components.interfaces.nsIPrefBranchInternal);
@ -1086,8 +1086,8 @@ function nonBrowserWindowStartup()
function nonBrowserWindowDelayedStartup()
{
// loads the services
initServices();
#ifndef MOZ_PLACES
initServices();
initBMService();
#endif
@ -1594,6 +1594,7 @@ function addBookmarkAs(aBrowser, aBookmarkAllTabs, aIsWebPanel)
function addBookmarkForTabBrowser(aTabBrowser, aBookmarkAllTabs, aSelect)
{
#ifndef MOZ_PLACES
var tabsInfo = [];
var currentTabInfo = { name: "", url: "", charset: null };
@ -1625,10 +1626,14 @@ function addBookmarkForTabBrowser(aTabBrowser, aBookmarkAllTabs, aSelect)
dialogArgs.objGroup = tabsInfo;
openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "",
BROWSER_ADD_BM_FEATURES, dialogArgs);
#else
dump("*** IMPLEMENT ME\n");
#endif
}
function addBookmarkForBrowser(aDocShell, aIsWebPanel)
{
#ifndef MOZ_PLACES
// Bug 52536: We obtain the URL and title from the nsIWebNavigation
// associated with a <browser/> rather than from a DOMWindow.
// This is because when a full page plugin is loaded, there is
@ -1646,6 +1651,9 @@ function addBookmarkForBrowser(aDocShell, aIsWebPanel)
title = url;
}
BookmarksUtils.addBookmark(url, title, charSet, aIsWebPanel, description);
#else
dump("*** IMPLEMENT ME\n");
#endif
}
function openLocation()
@ -2615,8 +2623,12 @@ var bookmarksButtonObserver = {
name: split[1],
url: url
}
#ifndef MOZ_PLACES
openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "",
BROWSER_ADD_BM_FEATURES, dialogArgs);
#else
dump("*** IMPLEMENT ME");
#endif
}
},
@ -3117,10 +3129,10 @@ function BrowserToolboxCustomizeDone(aToolboxChanged)
document.getElementById("Browser:Reload").getAttribute("disabled") == "true";
}
#ifndef MOZ_PLACES
// fix up the personal toolbar folder
var bt = document.getElementById("bookmarks-ptf");
if (bt) {
#ifndef MOZ_PLACES
var btf = BMSVC.getBookmarksToolbarFolder().Value;
var btchevron = document.getElementById("bookmarks-chevron");
bt.ref = btf;
@ -3134,12 +3146,12 @@ function BrowserToolboxCustomizeDone(aToolboxChanged)
bt.database.AddObserver(BookmarksToolbarRDFObserver);
bt.builder.rebuild();
btchevron.builder.rebuild();
#endif
// fake a resize; this function takes care of flowing bookmarks
// from the bar to the overflow item
BookmarksToolbar.resizeFunc(null);
}
#endif
// XXX Shouldn't have to do this, but I do
window.focus();
@ -3413,8 +3425,10 @@ nsBrowserStatusHandler.prototype =
var browser = gBrowser.mCurrentBrowser;
if (!gBrowser.mTabbedMode && !browser.mIconURL)
gBrowser.useDefaultIcon(gBrowser.mCurrentTab);
#ifndef MOZ_PLACES
if (browser.mIconURL)
BookmarksUtils.loadFavIcon(browser.currentURI.spec, browser.mIconURL);
#endif
}
}
@ -4732,12 +4746,17 @@ nsContextMenu.prototype = {
},
addBookmark : function() {
var docshell = document.getElementById( "content" ).webNavigation;
#ifndef MOZ_PLACES
BookmarksUtils.addBookmark( docshell.currentURI.spec,
docshell.document.title,
docshell.document.charset,
BookmarksUtils.getDescriptionFromDocument(docshell.document));
#else
dump("*** IMPLEMENT ME\n");
#endif
},
addBookmarkForFrame : function() {
#ifndef MOZ_PLACES
var doc = this.target.ownerDocument;
var uri = doc.location.href;
var title = doc.title;
@ -4745,6 +4764,9 @@ nsContextMenu.prototype = {
if ( !title )
title = uri;
BookmarksUtils.addBookmark(uri, title, doc.charset, description);
#else
dump("*** IMPLEMENT ME\n");
#endif
},
// Open Metadata window for node
showMetadata : function () {
@ -5094,9 +5116,13 @@ function asyncOpenWebPanel(event)
url: wrapper.href,
bWebPanel: true
}
#ifndef MOZ_PLACES
openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "",
BROWSER_ADD_BM_FEATURES, dialogArgs);
event.preventDefault();
#else
dump("*** IMPLEMENT ME");
#endif
return false;
}
else if (target == "_search") {
@ -5824,6 +5850,7 @@ function AddKeywordForSearchField()
else
spec += "?" + formData.join("&");
#ifndef MOZ_PLACES
var dialogArgs = {
name: "",
url: spec,
@ -5836,6 +5863,9 @@ function AddKeywordForSearchField()
}
openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "",
BROWSER_ADD_BM_FEATURES, dialogArgs);
#else
dump("*** IMPLEMENT ME\n");
#endif
}
function SwitchDocumentDirection(aWindow) {
@ -6114,8 +6144,12 @@ var FeedHandler = {
addLiveBookmark: function(url) {
var doc = gBrowser.selectedBrowser.contentDocument;
var title = doc.title;
#ifndef MOZ_PLACES
var description = BookmarksUtils.getDescriptionFromDocument(doc);
BookmarksUtils.addLivemark(doc.baseURI, url, title, description);
#else
dump("*** IMPLEMENT ME\n");
#endif
},
/**

View File

@ -67,7 +67,7 @@ var PlacesBrowserShim = {
this._strings = document.getElementById("placeBundle");
// Override the old addLivemark function
BookmarksUtils.addLivemark = function(a,b,c,d) {PlacesBrowserShim.addLivemark(a,b,c,d);};
//BookmarksUtils.addLivemark = function(a,b,c,d) {PlacesBrowserShim.addLivemark(a,b,c,d);};
var newMenuPopup = document.getElementById("bookmarksMenuPopup");
var query = this._hist.getNewQuery();