Part of bug 575740. Fix some js components in mail/ to work with the new component manager. r=Standard8. Part bustage fix for CLOSED TREE
authorDavid Bienvenu <bienvenu@nventure.com>
Mon, 05 Jul 2010 16:32:44 +0100
changeset 5936 1eb74b7e9acb7df264725547444bf120373a9f52
parent 5935 43417c1f109fe36ebac38e77cff0e5e1ce021e74
child 5937 5a0e5c7aef1fae49e9d836aa01302370b808fffc
push idunknown
push userunknown
push dateunknown
reviewersStandard8
bugs575740
Part of bug 575740. Fix some js components in mail/ to work with the new component manager. r=Standard8. Part bustage fix for CLOSED TREE
mail/components/Makefile.in
mail/components/aboutRights.js
mail/components/activity/Makefile.in
mail/components/activity/activityComponents.manifest
mail/components/activity/nsActivity.js
mail/components/activity/nsActivityManager.js
mail/components/activity/nsActivityManagerUI.js
mail/components/mailComponents.manifest
mail/components/nsMailDefaultHandler.js
mail/steel/Makefile.in
mail/steel/steelApplication.js
mail/steel/steelApplication.manifest
--- a/mail/components/Makefile.in
+++ b/mail/components/Makefile.in
@@ -59,16 +59,17 @@ DIRS += history
 endif
 
 DIRS += build
 
 EXTRA_COMPONENTS = \
 	nsMailDefaultHandler.js \
 	mailContentHandler.js \
 	aboutRights.js \
+	mailComponents.manifest \
 	$(NULL)
 
 EXTRA_JS_MODULES = \
   appIdleManager.js \
   $(NULL)
 
 
 include $(topsrcdir)/config/rules.mk
--- a/mail/components/aboutRights.js
+++ b/mail/components/aboutRights.js
@@ -38,17 +38,16 @@
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 function AboutRights() {}
 AboutRights.prototype = {
   classDescription: "about:rights",
-  contractID: "@mozilla.org/network/protocol/about;1?what=rights",
   classID: Components.ID("{8cc51368-6aa0-43e8-b762-bde9b9fd828c}"),
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),
 
   getURIFlags: function(aURI) {
     return (Ci.nsIAboutModule.ALLOW_SCRIPT |
             Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT);
   },
 
@@ -65,10 +64,9 @@ AboutRights.prototype = {
 
     channel.originalURI = aURI;
     channel.owner = principal;
 
     return channel;
   }
 };
 
-function NSGetModule(compMgr, fileSpec)
-  XPCOMUtils.generateModule([AboutRights]);
+const NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutRights]);
--- a/mail/components/activity/Makefile.in
+++ b/mail/components/activity/Makefile.in
@@ -44,16 +44,17 @@ VPATH		= @srcdir@
 include $(DEPTH)/config/autoconf.mk
 
 MODULE    = activity
 
 EXTRA_COMPONENTS = \
   nsActivity.js \
   nsActivityManager.js \
   nsActivityManagerUI.js \
+  activityComponents.manifest \
   $(NULL)
 
 XPIDLSRCS = nsIActivity.idl \
             nsIActivityManager.idl \
             nsIActivityManagerUI.idl \
             $(NULL)
 
 libs:: $(wildcard $(srcdir)/modules/*.js)
new file mode 100644
--- /dev/null
+++ b/mail/components/activity/activityComponents.manifest
@@ -0,0 +1,11 @@
+component {B2C036A3-F7CE-401C-95EE-9C21505167FD} nsActivity.js
+contract @mozilla.org/activity-process;1 {B2C036A3-F7CE-401C-95EE-9C21505167FD}
+component {87AAEB20-89D9-4B95-9542-3BF72405CAB2} nsActivity.js
+contract @mozilla.org/activity-event;1 {87AAEB20-89D9-4B95-9542-3BF72405CAB2}
+component {968BAC9E-798B-4952-B384-86B21B8CC71E} nsActivity.js
+contract @mozilla.org/activity-warning;1 {968BAC9E-798B-4952-B384-86B21B8CC71E}
+
+component {8aa5972e-19cb-41cc-9696-645f8a8d1a06} nsActivityManager.js
+contract @mozilla.org/activity-manager;1 {8aa5972e-19cb-41cc-9696-645f8a8d1a06}
+component {5fa5974e-09cb-40cc-9696-643f8a8d9a06} nsActivityManagerUI.js
+contract @mozilla.org/activity-manager-ui;1 {5fa5974e-09cb-40cc-9696-643f8a8d9a06}
--- a/mail/components/activity/nsActivity.js
+++ b/mail/components/activity/nsActivity.js
@@ -107,19 +107,17 @@ function nsActivityProcess()
 {
   nsActivity.call(this);
   this.bindingName = "activity-process";
   this.groupingStyle = Ci.nsIActivity.GROUPING_STYLE_BYCONTEXT;
 }
 
 nsActivityProcess.prototype = {
   __proto__: nsActivity.prototype,
-  classDescription: "Activity:Process",
   classID: Components.ID("B2C036A3-F7CE-401C-95EE-9C21505167FD"),
-  contractID: "@mozilla.org/activity-process;1",
 
   //////////////////////////////////////////////////////////////////////////////
   //// nsIActivityProcess
 
   percentComplete: -1,
   lastStatusText: "",
   workUnitComplete: 0,
   totalWorkUnits: 0,
@@ -280,19 +278,17 @@ function nsActivityEvent()
 {
   nsActivity.call(this);
   this.bindingName = "activity-event";
   this.groupingStyle = Ci.nsIActivity.GROUPING_STYLE_STANDALONE;
 }
 
 nsActivityEvent.prototype = {
   __proto__: nsActivity.prototype,
-  classDescription: "Activity:Event",
   classID: Components.ID("87AAEB20-89D9-4B95-9542-3BF72405CAB2"),
-  contractID: "@mozilla.org/activity-event;1",
 
   //////////////////////////////////////////////////////////////////////////////
   //// nsIActivityEvent
 
   statusText: "",
   startTime: 0,
   completionTime: 0,
   _undoHandler: null,
@@ -337,19 +333,17 @@ function nsActivityWarning()
 {
   nsActivity.call(this);
   this.bindingName = "activity-warning";
   this.groupingStyle = Ci.nsIActivity.GROUPING_STYLE_BYCONTEXT;
 }
 
 nsActivityWarning.prototype = {
   __proto__: nsActivity.prototype,
-  classDescription: "Activity:Warning",
   classID: Components.ID("968BAC9E-798B-4952-B384-86B21B8CC71E"),
-  contractID: "@mozilla.org/activity-warning;1",
 
   //////////////////////////////////////////////////////////////////////////////
   //// nsIActivityWarning
   
   recoveryTipText: "",
   _time: 0,
   _recoveryHandler: null,
   
@@ -383,13 +377,9 @@ nsActivityWarning.prototype = {
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIActivityWarning, Ci.nsIActivity])
 };
 
 ///////////////////////////////////////////////////////////////////////////////
 //// Module
 
 let components = [nsActivityProcess, nsActivityEvent, nsActivityWarning];
-
-function NSGetModule(compMgr, fileSpec)
-{
-  return XPCOMUtils.generateModule(components);
-}
+const NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
--- a/mail/components/activity/nsActivityManager.js
+++ b/mail/components/activity/nsActivityManager.js
@@ -50,20 +50,18 @@ const Cr = Components.results;
 
 ////////////////////////////////////////////////////////////////////////////////
 //// nsActivityManager class
 
 function nsActivityManager()
 {}
 
 nsActivityManager.prototype = {
-  classDescription: "Used to manage the activities",
   classID: Components.ID("8aa5972e-19cb-41cc-9696-645f8a8d1a06"),
-  contractID: "@mozilla.org/activity-manager;1",
-  
+
   //////////////////////////////////////////////////////////////////////////////
   //// nsIActivityManager
   log: Log4Moz.getConfiguredLogger("nsActivityManager"),
   _listeners: [],
   _processCount: 0,
   _db: null,
   _idCounter: 1,
   _activities: {},
@@ -209,14 +207,9 @@ nsActivityManager.prototype = {
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIActivityManager])
 };
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Module
 
 let components = [nsActivityManager];
-
-function NSGetModule(compMgr, fileSpec)
-{
-  return XPCOMUtils.generateModule(components);
-}
-
+const NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
--- a/mail/components/activity/nsActivityManagerUI.js
+++ b/mail/components/activity/nsActivityManagerUI.js
@@ -50,19 +50,17 @@ const PREF_FLASH_COUNT = "messenger.acti
 
 ////////////////////////////////////////////////////////////////////////////////
 //// nsActivityManagerUI class
 
 function nsActivityManagerUI()
 {}
 
 nsActivityManagerUI.prototype = {
-  classDescription: "Used to show the Activity Manager's UI to the user",
   classID: Components.ID("5fa5974e-09cb-40cc-9696-643f8a8d9a06"),
-  contractID: "@mozilla.org/activity-manager-ui;1",
 
   //////////////////////////////////////////////////////////////////////////////
   //// nsIActivityManagerUI
 
   show: function show(aWindowContext, aID) {
     // First we see if it is already visible
     let window = this.recentWindow;
     if (window) {
@@ -103,14 +101,9 @@ nsActivityManagerUI.prototype = {
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIActivityManagerUI])
 };
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Module
 
 let components = [nsActivityManagerUI];
-
-function NSGetModule(compMgr, fileSpec)
-{
-  return XPCOMUtils.generateModule(components);
-}
-
+const NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
new file mode 100644
--- /dev/null
+++ b/mail/components/mailComponents.manifest
@@ -0,0 +1,7 @@
+component {8cc51368-6aa0-43e8-b762-bde9b9fd828c} aboutRights.js
+contract @mozilla.org/network/protocol/about;1?what=rights {8cc51368-6aa0-43e8-b762-bde9b9fd828c}
+
+component {44346520-c5d2-44e5-a1ec-034e04d7fac4} nsMailDefaultHandler.js
+contract @mozilla.org/mail/clh;1 {44346520-c5d2-44e5-a1ec-034e04d7fac4}
+category command-line-handler x-default @mozilla.org/mail/clh;1
+category command-line-validator b-default @mozilla.org/mail/clh;1
--- a/mail/components/nsMailDefaultHandler.js
+++ b/mail/components/nsMailDefaultHandler.js
@@ -473,21 +473,12 @@ function mailDefaultCommandLineHandler()
 
 mailDefaultCommandLineHandler.prototype = {
   classDescription: "Mail default commandline handler",
   classID: Components.ID("{44346520-c5d2-44e5-a1ec-034e04d7fac4}"),
   contractID: "@mozilla.org/mail/clh;1",
 
   QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIModule]),
 
-  _xpcom_categories:
-    [ { category: "command-line-handler",
-        entry: "x-default" },
-      { category: "command-line-validator",
-        entry: "b-default" } ],
-
   _xpcom_factory: nsMailDefaultHandler
 }
 
-// NSGetModule: Return the nsIModule object.
-function NSGetModule(compMgr, fileSpec) {
-  return XPCOMUtils.generateModule([mailDefaultCommandLineHandler]);
-}
+const NSGetFactory = XPCOMUtils.generateNSGetFactory([mailDefaultCommandLineHandler]);
--- a/mail/steel/Makefile.in
+++ b/mail/steel/Makefile.in
@@ -43,17 +43,18 @@ VPATH     = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE        = steel
 XPIDL_MODULE  = steel
 
 XPIDLSRCS = steelIApplication.idl
 
-EXTRA_PP_COMPONENTS = steelApplication.js
+EXTRA_PP_COMPONENTS = steelApplication.js \
+                      steelApplication.manifest
 
 ifdef ENABLE_TESTS
 # These tests directories are explicitly done this way to ensure that we get
 # the correct result for platformIsMac.
 ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
 XPCSHELL_TESTS = mac
 else
 XPCSHELL_TESTS = notmac
--- a/mail/steel/steelApplication.js
+++ b/mail/steel/steelApplication.js
@@ -58,19 +58,17 @@ var ApplicationFactory = {
   }
 };
 
 function Application() {
   this.initToolkitHelpers();
 }
 
 Application.prototype = {
-  classDescription: "Application",
   classID:          Components.ID("f265021a-7f1d-4b4b-bdc6-9aedca4d8f13"),
-  contractID:       "@mozilla.org/steel/application;1",
 
   // redefine the default factory for XPCOMUtils
   _xpcom_factory: ApplicationFactory,
 
   // for nsISupports
   QueryInterface : XPCOMUtils.generateQI([Ci.steelIApplication, Ci.extIApplication, Ci.nsIObserver, Ci.nsIClassInfo]),
 
   getInterfaces : function app_gi(aCount) {
@@ -78,18 +76,14 @@ Application.prototype = {
     aCount.value = interfaces.length;
     return interfaces;
   },
 
   // for steelIApplication
   platformIsMac: "nsILocalFileMac" in Components.interfaces
 };
 
-//module initialization
-function NSGetModule(aCompMgr, aFileSpec) {
-  // set the proto
-  Application.prototype.__proto__ = extApplication.prototype;
+#include ../../mozilla/toolkit/components/exthelper/extApplication.js
 
-  // now we can finally return our module
-  return XPCOMUtils.generateModule([Application]);
-}
+Application.prototype.__proto__ = extApplication.prototype;
 
-#include ../../mozilla/toolkit/components/exthelper/extApplication.js
+const NSGetFactory = XPCOMUtils.generateNSGetFactory([Application]);
+
new file mode 100644
--- /dev/null
+++ b/mail/steel/steelApplication.manifest
@@ -0,0 +1,3 @@
+component {f265021a-7f1d-4b4b-bdc6-9aedca4d8f13} steelApplication.js
+contract @mozilla.org/steel/application;1 {f265021a-7f1d-4b4b-bdc6-9aedca4d8f13}
+category JavaScript-global-privileged-property Application @mozilla.org/steel/application;1