michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: "use strict"; michael@0: michael@0: const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; michael@0: Cu.import("resource://gre/modules/XPCOMUtils.jsm"); michael@0: Cu.import("resource://gre/modules/Services.jsm"); michael@0: michael@0: this.IDService = function IDService() { michael@0: this.wrappedJSObject = this; michael@0: }; michael@0: michael@0: this.IDService.prototype = { michael@0: classID: Components.ID("{4e0a0e98-b1d3-4745-a1eb-f815199dd06b}"), michael@0: michael@0: QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, michael@0: Ci.nsISupportsWeakReference]), michael@0: michael@0: observe: function observe(subject, topic, data) { michael@0: switch (topic) { michael@0: case "app-startup": michael@0: Services.obs.addObserver(this, "final-ui-startup", true); michael@0: break; michael@0: case "final-ui-startup": michael@0: // Startup DOMIdentity.jsm michael@0: Cu.import("resource://gre/modules/DOMIdentity.jsm"); michael@0: DOMIdentity._init(); michael@0: break; michael@0: } michael@0: } michael@0: }; michael@0: michael@0: this.NSGetFactory = XPCOMUtils.generateNSGetFactory([IDService]);