Bug 451909 - kill MOZ_XUL_APP now that all apps set it; extensions cleanup (spellchecker, layout-debug); r+sr=(bienvenu + dbaron)
authorArpad Borsos <arpad.borsos@googlemail.com>
Mon, 20 Oct 2008 14:33:11 +0200
changeset 20661 f9f55538ed8c663edc197d96fbd9f4f43a148848
parent 20660 5f7f7935d508325d54b93779d05b658cc2ac0ac7
child 20662 449af6c4ca81f9d38d369e8f5578f6738d4ada93
push idunknown
push userunknown
push dateunknown
bugs451909
milestone1.9.1b2pre
Bug 451909 - kill MOZ_XUL_APP now that all apps set it; extensions cleanup (spellchecker, layout-debug); r+sr=(bienvenu + dbaron)
extensions/layout-debug/src/nsDebugFactory.cpp
extensions/layout-debug/src/nsLayoutDebugCLH.cpp
extensions/layout-debug/src/nsLayoutDebugCLH.h
extensions/spellcheck/src/mozSpellCheckerFactory.cpp
--- a/extensions/layout-debug/src/nsDebugFactory.cpp
+++ b/extensions/layout-debug/src/nsDebugFactory.cpp
@@ -45,18 +45,16 @@
 #include "nsIGenericFactory.h"
 #include "nsICategoryManager.h"
 #include "nsIServiceManager.h"
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsRegressionTester)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsLayoutDebuggingTools)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsLayoutDebugCLH)
 
-#ifdef MOZ_XUL_APP
-
 static NS_IMETHODIMP
 RegisterCommandLineHandlers(nsIComponentManager* compMgr, nsIFile* path,
                             const char *location, const char *type,
                             const nsModuleComponentInfo *info)
 {
   nsresult rv;
   nsCOMPtr<nsICategoryManager> catMan (do_GetService(NS_CATEGORYMANAGER_CONTRACTID));
   NS_ENSURE_TRUE(catMan, NS_ERROR_FAILURE);
@@ -79,37 +77,30 @@ UnregisterCommandLineHandlers(nsICompone
   NS_ENSURE_TRUE(catMan, NS_ERROR_FAILURE);
 
   catMan->DeleteCategoryEntry("command-line-handler", "m-layoutdebug",
                               PR_TRUE);
 
   return NS_OK;
 }
 
-#endif
-
 static const nsModuleComponentInfo components[] =
 {
   { "nsRegressionTester",
     NS_REGRESSION_TESTER_CID,
     "@mozilla.org/layout-debug/regressiontester;1",
     nsRegressionTesterConstructor 
   },
   { "nsLayoutDebuggingTools",
     NS_LAYOUT_DEBUGGINGTOOLS_CID,
     NS_LAYOUT_DEBUGGINGTOOLS_CONTRACTID,
     nsLayoutDebuggingToolsConstructor
   },
   { "LayoutDebug Startup Handler",
     NS_LAYOUTDEBUGCLH_CID,
     "@mozilla.org/commandlinehandler/general-startup;1?type=layoutdebug",
     nsLayoutDebugCLHConstructor,
-#ifdef MOZ_XUL_APP
     RegisterCommandLineHandlers,
     UnregisterCommandLineHandlers
-#else
-    nsLayoutDebugCLH::RegisterProc,
-    nsLayoutDebugCLH::UnregisterProc
-#endif
   }
 };
 
 NS_IMPL_NSGETMODULE(nsLayoutDebugModule, components)
--- a/extensions/layout-debug/src/nsLayoutDebugCLH.cpp
+++ b/extensions/layout-debug/src/nsLayoutDebugCLH.cpp
@@ -41,33 +41,28 @@
 #include "nsString.h"
 #include "plstr.h"
 #include "nsCOMPtr.h"
 #include "nsIWindowWatcher.h"
 #include "nsIServiceManager.h"
 #include "nsIDOMWindow.h"
 #include "nsISupportsArray.h"
 #include "nsISupportsPrimitives.h"
-
-#ifdef MOZ_XUL_APP
 #include "nsICommandLine.h"
-#endif
 
 nsLayoutDebugCLH::nsLayoutDebugCLH()
 {
 }
 
 nsLayoutDebugCLH::~nsLayoutDebugCLH()
 {
 }
 
 NS_IMPL_ISUPPORTS1(nsLayoutDebugCLH, ICOMMANDLINEHANDLER)
 
-#ifdef MOZ_XUL_APP
-
 NS_IMETHODIMP
 nsLayoutDebugCLH::Handle(nsICommandLine* aCmdLine)
 {
     nsresult rv;
     PRBool found;
 
     PRInt32 idx;
     rv = aCmdLine->FindFlag(NS_LITERAL_STRING("layoutdebug"), PR_FALSE, &idx);
@@ -116,21 +111,8 @@ nsLayoutDebugCLH::Handle(nsICommandLine*
 
 NS_IMETHODIMP
 nsLayoutDebugCLH::GetHelpInfo(nsACString& aResult)
 {
     aResult.Assign(NS_LITERAL_CSTRING("  -layoutdebug [<url>] Start with Layout Debugger\n"));
     return NS_OK;
 }
 
-#else // !MOZ_XUL_APP
-
-CMDLINEHANDLER_IMPL(nsLayoutDebugCLH, "-layoutdebug",
-                    "general.startup.layoutdebug",
-                    "chrome://layoutdebug/content/",
-                    "Start with Layout Debugger",
-                    "@mozilla.org/commandlinehandler/general-startup;1?type=layoutdebug",
-                    "LayoutDebug Startup Handler",
-                    PR_TRUE,
-                    "",
-                    PR_TRUE)
-
-#endif
--- a/extensions/layout-debug/src/nsLayoutDebugCLH.h
+++ b/extensions/layout-debug/src/nsLayoutDebugCLH.h
@@ -35,36 +35,26 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsLayoutDebugCLH_h_
 #define nsLayoutDebugCLH_h_
 
-#ifdef MOZ_XUL_APP
 #include "nsICommandLineHandler.h"
 #define ICOMMANDLINEHANDLER nsICommandLineHandler
-#else
-#include "nsICmdLineHandler.h"
-#define ICOMMANDLINEHANDLER nsICmdLineHandler
-#endif
 
 #define NS_LAYOUTDEBUGCLH_CID \
  { 0xa8f52633, 0x5ecf, 0x424a, \
    { 0xa1, 0x47, 0x47, 0xc3, 0x22, 0xf7, 0xbc, 0xe2 }}
 
 class nsLayoutDebugCLH : public ICOMMANDLINEHANDLER
 {
 public:
     nsLayoutDebugCLH();
     virtual ~nsLayoutDebugCLH();
 
     NS_DECL_ISUPPORTS
-#ifdef MOZ_XUL_APP
     NS_DECL_NSICOMMANDLINEHANDLER
-#else
-    NS_DECL_NSICMDLINEHANDLER
-    CMDLINEHANDLER_REGISTERPROC_DECLS
-#endif
 };
 
 #endif /* !defined(nsLayoutDebugCLH_h_) */
--- a/extensions/spellcheck/src/mozSpellCheckerFactory.cpp
+++ b/extensions/spellcheck/src/mozSpellCheckerFactory.cpp
@@ -36,20 +36,18 @@
 
 
 #include "nsIGenericFactory.h"
 
 #ifdef MOZ_MACBROWSER
 #include "mozOSXSpell.h"
 #else
 #include "mozHunspell.h"
-#ifdef MOZ_XUL_APP
 #include "mozHunspellDirProvider.h"
 #endif
-#endif
 
 #include "mozSpellChecker.h"
 #include "mozInlineSpellChecker.h"
 #include "nsTextServicesCID.h"
 #include "mozPersonalDictionary.h"
 #include "mozSpellI18NManager.h"
 
 #define NS_SPELLCHECKER_CID         \
@@ -67,20 +65,18 @@ 0x9fe5d975, 0x9bd, 0x44aa,              
 //
 // NOTE: This creates an instance of objects by using the default constructor
 //
 
 #ifdef MOZ_MACBROWSER
 NS_GENERIC_FACTORY_CONSTRUCTOR(mozOSXSpell)
 #else
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(mozHunspell, Init)
-#ifdef MOZ_XUL_APP
 NS_GENERIC_FACTORY_CONSTRUCTOR(mozHunspellDirProvider)
 #endif
-#endif
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(mozSpellChecker, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(mozPersonalDictionary, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(mozSpellI18NManager)
 
 // This special constructor for the inline spell checker asks the inline
 // spell checker if we can create spell checking objects at all (ie, if there
 // are any dictionaries loaded) before trying to create one. The static
@@ -131,26 +127,24 @@ static nsModuleComponentInfo components[
     },
 #else
     {
         "mozHunspell",
         MOZ_HUNSPELL_CID,
         MOZ_HUNSPELL_CONTRACTID,
         mozHunspellConstructor
     },
-#ifdef MOZ_XUL_APP
     {
         "mozHunspellDirProvider",
         HUNSPELLDIRPROVIDER_CID,
         mozHunspellDirProvider::kContractID,
         mozHunspellDirProviderConstructor,
         mozHunspellDirProvider::Register,
         mozHunspellDirProvider::Unregister
     },
-#endif // MOZ_XUL_APP
 #endif // MOZ_MACBROWSER
   {
       NULL,
       NS_SPELLCHECKER_CID,
       NS_SPELLCHECKER_CONTRACTID,
       mozSpellCheckerConstructor
   },
   {