Bug 363636. duplicate nsLivemarkService.getSiteURI in toolbar.xml. r=sspitzer/gavin

This commit is contained in:
sayrer%gmail.com 2006-12-13 01:05:31 +00:00
Родитель 472a6d0a36
Коммит 1cd965fc5d
2 изменённых файлов: 20 добавлений и 7 удалений

Просмотреть файл

@ -116,10 +116,7 @@
this._anno =
Cc["@mozilla.org/browser/annotation-service;1"].
getService(Ci.nsIAnnotationService);
this._lms =
Cc["@mozilla.org/browser/livemark-service;2"].
getService(Ci.nsILivemarkService);
this._bms.addObserver(this._observer, false);
var t = this;
window.addEventListener("resize",
@ -230,10 +227,20 @@
if (PlacesController.nodeIsLivemarkContainer(child)) {
button.setAttribute("livemark", "true");
var folder = asFolder(child).folderId;
var siteURI = this._lms.getSiteURI(folder);
if (siteURI) {
button.setAttribute("siteURI", siteURI.spec);
// duplicate nsLivemarkService.getSiteURI to avoid instantiating
// the service on startup.
var containerURI = this._bms.getFolderURI(folder);
var siteURIString;
try {
siteURIString =
this._anno.getAnnotationString(containerURI, "livemark/siteURI");
}
catch (ex) {}
// end duplication
if (siteURIString)
button.setAttribute("siteURI", siteURIString);
}
var popup = document.createElementNS(XULNS, "menupopup");
popup.setAttribute("type", "places");

Просмотреть файл

@ -303,6 +303,12 @@ LivemarkService.prototype = {
throw Cr.NS_ERROR_INVALID_ARG;
},
/**
* n.b. -- the body of this method is duplicated in
* /browser/components/places/content/toolbar.xml
* to avoid instantiating the livemark service on
* startup.
*/
getSiteURI: function LS_getSiteURI(container) {
this._ensureLivemark(container);
var containerURI = this._bms.getFolderURI(container);