зеркало из https://github.com/mozilla/gecko-dev.git
initial about:weave impl (does nothing)
This commit is contained in:
Родитель
5f11ba4ef2
Коммит
5d883571a6
|
@ -34,7 +34,11 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
function WeaveService() {}
|
||||
WeaveService.prototype = {
|
||||
|
@ -43,28 +47,51 @@ WeaveService.prototype = {
|
|||
classID: Components.ID("{74b89fb0-f200-4ae8-a3ec-dd164117f6de}"),
|
||||
_xpcom_categories: [{ category: "app-startup", service: true }],
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIObserver,
|
||||
Components.interfaces.nsISupportsWeakReference]),
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
|
||||
Ci.nsISupportsWeakReference]),
|
||||
|
||||
observe: function BSS__observe(subject, topic, data) {
|
||||
switch (topic) {
|
||||
case "app-startup":
|
||||
let os = Components.classes["@mozilla.org/observer-service;1"].
|
||||
getService(Components.interfaces.nsIObserverService);
|
||||
let os = Cc["@mozilla.org/observer-service;1"].
|
||||
getService(Ci.nsIObserverService);
|
||||
os.addObserver(this, "sessionstore-windows-restored", true);
|
||||
break;
|
||||
/* The following event doesn't exist on Fennec; for Fennec loading, see
|
||||
* fennec-weave-overlay.js.
|
||||
*/
|
||||
case "sessionstore-windows-restored":
|
||||
Components.utils.import("resource://weave/service.js");
|
||||
Cu.import("resource://weave/service.js");
|
||||
Weave.Service.onStartup();
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function AboutWeaveService() {}
|
||||
AboutWeaveService.prototype = {
|
||||
classDescription: "about:weave",
|
||||
contractID: "@mozilla.org/network/protocol/about;1?what=weave",
|
||||
classID: Components.ID("{ecb6987d-9d71-475d-a44d-a5ff2099b08c}"),
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule,
|
||||
Ci.nsISupportsWeakReference]),
|
||||
|
||||
getURIFlags: function(aURI) {
|
||||
return (Ci.nsIAboutModule.ALLOW_SCRIPT |
|
||||
Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT);
|
||||
},
|
||||
|
||||
newChannel: function(aURI) {
|
||||
let ios = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService);
|
||||
let ch = ios.newChannel("chrome://weave/content/weave.html", null, null);
|
||||
ch.originalURI = aURI;
|
||||
return ch;
|
||||
}
|
||||
};
|
||||
|
||||
function NSGetModule(compMgr, fileSpec) {
|
||||
return XPCOMUtils.generateModule([WeaveService]);
|
||||
return XPCOMUtils.generateModule([WeaveService, AboutWeaveService]);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче