зеркало из https://github.com/mozilla/gecko-dev.git
Bug 363636. duplicate nsLivemarkService.getSiteURI in toolbar.xml. r=sspitzer/gavin
This commit is contained in:
Родитель
472a6d0a36
Коммит
1cd965fc5d
|
@ -116,9 +116,6 @@
|
|||
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;
|
||||
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче