Bug 1318735 - Fold suite binary component into xul. r=Ratty,IanN a=IanN
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Tue, 06 Dec 2016 18:59:03 +0100
changeset 27138 c2e84907d49c68601bb6669b8bdb4666de705eac
parent 27137 3981c0dc1eaeb4a05ce57fd6531d8c80621008ee
child 27139 8881e860371794a64312b206e086ec10f7f9a827
push id1878
push userclokep@gmail.com
push dateTue, 07 Mar 2017 14:18:40 +0000
treeherdercomm-beta@ab59ffd05575 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersRatty, IanN, IanN
bugs1318735
Bug 1318735 - Fold suite binary component into xul. r=Ratty,IanN a=IanN
suite/build/Makefile.in
suite/build/moz.build
suite/build/nsSuiteCID.h
suite/build/nsSuiteModule.cpp
suite/feeds/src/nsFeedSniffer.cpp
suite/feeds/src/nsFeedSniffer.h
suite/installer/package-manifest.in
suite/profile/migration/src/nsNetscapeProfileMigratorBase.cpp
suite/profile/migration/src/nsNetscapeProfileMigratorBase.h
suite/profile/migration/src/nsSuiteProfileMigratorUtils.cpp
suite/profile/migration/src/nsSuiteProfileMigratorUtils.h
suite/profile/migration/src/nsThunderbirdProfileMigrator.h
suite/profile/moz.build
suite/profile/nsSuiteDirectoryProvider.h
suite/shell/src/nsGNOMEShellService.cpp
suite/shell/src/nsGNOMEShellService.h
suite/shell/src/nsMacShellService.cpp
suite/shell/src/nsMacShellService.h
suite/shell/src/nsShellService.h
suite/shell/src/nsWindowsShellService.cpp
suite/shell/src/nsWindowsShellService.h
--- a/suite/build/Makefile.in
+++ b/suite/build/Makefile.in
@@ -1,6 +1,8 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+include $(topsrcdir)/config/rules.mk
+
 # Ensure that we don't embed a manifest referencing the CRT.
 EMBED_MANIFEST_AT =
--- a/suite/build/moz.build
+++ b/suite/build/moz.build
@@ -1,30 +1,30 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+EXPORTS += [
+    'nsSuiteCID.h',
+]
+
 SOURCES += [
     'nsSuiteModule.cpp',
 ]
 
-XPCOMBinaryComponent('suite')
+Library('suite')
+FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '/suite/feeds/src',
     '/suite/profile',
     '/suite/profile/migration/src',
     '/suite/shell/src',
 ]
 
-USE_LIBS += [
-    'xpcomglue_s',
-    'xul',
-]
-
 if CONFIG['OS_ARCH'] == 'WINNT':
     OS_LIBS += [
         'ole32',
         'shell32',
     ]
 
 OS_LIBS += CONFIG['TK_LIBS']
new file mode 100644
--- /dev/null
+++ b/suite/build/nsSuiteCID.h
@@ -0,0 +1,24 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+// {e5eeef51-05ce-4885-9434-7287616d9547}
+#define NS_FEEDSNIFFER_CID \
+  { 0xe5eeef51, 0x5ce, 0x4885, { 0x94, 0x34, 0x72, 0x87, 0x61, 0x6d, 0x95, 0x47 } }
+
+#define NS_FEEDSNIFFER_CONTRACTID \
+  "@mozilla.org/browser/feeds/sniffer;1"
+  
+// {39b688ec-e308-49e5-be6b-28dc7fcd6154}
+#define NS_SHELLSERVICE_CID \
+  { 0x39b688ec, 0xe308, 0x49e5, { 0xbe, 0x6b, 0x28, 0xdc, 0x7f, 0xcd, 0x61, 0x54 } }
+
+#define NS_SHELLSERVICE_CONTRACTID \
+  "@mozilla.org/suite/shell-service;1"
+
+// {9aa21826-9d1d-433d-8c10-f313b26fa9dd}
+#define NS_SUITEDIRECTORYPROVIDER_CID \
+  { 0x9aa21826, 0x9d1d, 0x433d, { 0x8c, 0x10, 0xf3, 0x13, 0xb2, 0x6f, 0xa9, 0xdd } }
+
+#define NS_SUITEDIRECTORYPROVIDER_CONTRACTID \
+  "@mozilla.org/suite/directory-provider;1"
--- a/suite/build/nsSuiteModule.cpp
+++ b/suite/build/nsSuiteModule.cpp
@@ -15,63 +15,64 @@
 #elif defined(XP_MACOSX)
 #include "nsMacShellService.h"
 #elif defined(MOZ_WIDGET_GTK)
 #include "nsGNOMEShellService.h"
 #endif
 
 #define NS_SUITEPROFILEMIGRATOR_CONTRACTID_PREFIX "@mozilla.org/profile/migrator;1?app=suite&type="
 
+using namespace mozilla;
 /////////////////////////////////////////////////////////////////////////////
 
 #if defined(XP_WIN)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowsShellService, Init)
 #elif defined(XP_MACOSX)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacShellService)
 #elif defined(MOZ_WIDGET_GTK)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
 #endif
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSuiteDirectoryProvider)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsThunderbirdProfileMigrator)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsFeedSniffer)
 
-#if defined(NS_SUITEWININTEGRATION_CID)
-NS_DEFINE_NAMED_CID(NS_SUITEWININTEGRATION_CID);
-#elif defined(NS_SUITEMACINTEGRATION_CID)
-NS_DEFINE_NAMED_CID(NS_SUITEMACINTEGRATION_CID);
-#elif defined(NS_SUITEGNOMEINTEGRATION_CID)
-NS_DEFINE_NAMED_CID(NS_SUITEGNOMEINTEGRATION_CID);
+#if defined(XP_WIN)
+NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID);
+#elif defined(XP_MACOSX)
+NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID);
+#elif defined(MOZ_WIDGET_GTK)
+NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID);
 #endif
 NS_DEFINE_NAMED_CID(NS_SUITEDIRECTORYPROVIDER_CID);
 NS_DEFINE_NAMED_CID(NS_THUNDERBIRDPROFILEMIGRATOR_CID);
 NS_DEFINE_NAMED_CID(NS_FEEDSNIFFER_CID);
 
 /////////////////////////////////////////////////////////////////////////////
 
 static const mozilla::Module::CIDEntry kSuiteCIDs[] = {
-#if defined(NS_SUITEWININTEGRATION_CID)
-  { &kNS_SUITEWININTEGRATION_CID, false, NULL, nsWindowsShellServiceConstructor },
-#elif defined(NS_SUITEMACINTEGRATION_CID)
-  { &kNS_SUITEMACINTEGRATION_CID, false, NULL, nsMacShellServiceConstructor },
-#elif defined(NS_SUITEGNOMEINTEGRATION_CID)
-  { &kNS_SUITEGNOMEINTEGRATION_CID, false, NULL, nsGNOMEShellServiceConstructor },
+#if defined(XP_WIN)
+  { &kNS_SHELLSERVICE_CID, false, NULL, nsWindowsShellServiceConstructor },
+#elif defined(XP_MACOSX)
+  { &kNS_SHELLSERVICE_CID, false, NULL, nsMacShellServiceConstructor },
+#elif defined(MOZ_WIDGET_GTK)
+  { &kNS_SHELLSERVICE_CID, false, NULL, nsGNOMEShellServiceConstructor },
 #endif
   { &kNS_SUITEDIRECTORYPROVIDER_CID, false, NULL, nsSuiteDirectoryProviderConstructor },
   { &kNS_THUNDERBIRDPROFILEMIGRATOR_CID, false, NULL, nsThunderbirdProfileMigratorConstructor },
   { &kNS_FEEDSNIFFER_CID, false, NULL, nsFeedSnifferConstructor },
   { NULL }
 };
 
 static const mozilla::Module::ContractIDEntry kSuiteContracts[] = {
-#if defined(NS_SUITEWININTEGRATION_CID)
-  { NS_SUITESHELLSERVICE_CONTRACTID, &kNS_SUITEWININTEGRATION_CID },
-#elif defined(NS_SUITEMACINTEGRATION_CID)
-  { NS_SUITESHELLSERVICE_CONTRACTID, &kNS_SUITEMACINTEGRATION_CID },
-#elif defined(NS_SUITEGNOMEINTEGRATION_CID)
-  { NS_SUITESHELLSERVICE_CONTRACTID, &kNS_SUITEGNOMEINTEGRATION_CID },
+#if defined(XP_WIN)
+  { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID },
+#elif defined(XP_MACOSX)
+  { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID },
+#elif defined(MOZ_WIDGET_GTK)
+  { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID },
 #endif
   { NS_SUITEDIRECTORYPROVIDER_CONTRACTID, &kNS_SUITEDIRECTORYPROVIDER_CID },
   { NS_SUITEPROFILEMIGRATOR_CONTRACTID_PREFIX "thunderbird", &kNS_THUNDERBIRDPROFILEMIGRATOR_CID },
   { NS_FEEDSNIFFER_CONTRACTID, &kNS_FEEDSNIFFER_CID },
   { NULL }
 };
 
 static const mozilla::Module::CategoryEntry kSuiteCategories[] = {
--- a/suite/feeds/src/nsFeedSniffer.cpp
+++ b/suite/feeds/src/nsFeedSniffer.cpp
@@ -173,19 +173,25 @@ IsDocumentElement(const char *start, con
  * @param   substring
  *          The substring being tested for existence and root-ness.
  * @returns true if the substring exists and is the documentElement, false
  *          otherwise.
  */
 static bool
 ContainsTopLevelSubstring(nsACString& dataString, const char *substring)
 {
-  int32_t offset = dataString.Find(substring);
-  if (offset == -1)
+  nsACString::const_iterator start, end;
+  dataString.BeginReading(start);
+  dataString.EndReading(end);
+
+  if (!FindInReadable(nsCString(substring), start, end)){
     return false;
+  }
+
+  auto offset = start.get() - dataString.Data();
 
   const char *begin = dataString.BeginReading();
 
   // Only do the validation when we find the substring.
   return IsDocumentElement(begin, begin + offset);
 }
 
 NS_IMETHODIMP
@@ -300,19 +306,20 @@ nsFeedSniffer::GetMIMETypeFromContent(ns
   isFeed = ContainsTopLevelSubstring(dataString, "<rss");
 
   // Atom 1.0
   if (!isFeed)
     isFeed = ContainsTopLevelSubstring(dataString, "<feed");
 
   // RSS 1.0
   if (!isFeed) {
+    bool foundNS_RDF = FindInReadable(NS_LITERAL_CSTRING(NS_RDF), dataString);
+    bool foundNS_RSS = FindInReadable(NS_LITERAL_CSTRING(NS_RSS), dataString);
     isFeed = ContainsTopLevelSubstring(dataString, "<rdf:RDF") &&
-      dataString.Find(NS_RDF) != -1 &&
-      dataString.Find(NS_RSS) != -1;
+      foundNS_RDF && foundNS_RSS;
   }
 
   // If we sniffed a feed, coerce our internal type
   if (isFeed && !HasAttachmentDisposition(channel))
     sniffedType.AssignLiteral(TYPE_MAYBE_FEED);
   else
     sniffedType.Truncate();
   return NS_OK;
--- a/suite/feeds/src/nsFeedSniffer.h
+++ b/suite/feeds/src/nsFeedSniffer.h
@@ -1,26 +1,19 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIContentSniffer.h"
 #include "nsIStreamListener.h"
-#include "nsStringAPI.h"
+#include "nsString.h"
+#include "nsSuiteCID.h"
 #include "mozilla/Attributes.h"
 
-#define NS_FEEDSNIFFER_CONTRACTID \
-  "@mozilla.org/browser/feeds/sniffer;1"
-
-// {E5EEEF51-05CE-4885-9434-7287616D9547}
-#define NS_FEEDSNIFFER_CID \
-  { 0xe5eeef51, 0x5ce, 0x4885, { 0x94, 0x34, 0x72, 0x87, 0x61, 0x6d, 0x95, 0x47 } }
-
-
 class nsFeedSniffer final : public nsIContentSniffer, nsIStreamListener
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSICONTENTSNIFFER
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
 
--- a/suite/installer/package-manifest.in
+++ b/suite/installer/package-manifest.in
@@ -146,20 +146,16 @@
 #endif
 @RESPATH@/license.txt
 @RESPATH@/blocklist.xml
 #ifdef UNIX_BUT_NOT_MAC
 @RESPATH@/run-mozilla.sh
 #endif
 
 ; [Components]
-; Although components.manifest ends up being shipped inside omni.jar
-; it still needs listing here as it is parsed for various binary
-; components before being packaged inside omni.jar.
-@RESPATH@/components/components.manifest
 #ifdef ACCESSIBILITY
 #ifdef XP_WIN32
 @BINPATH@/AccessibleMarshal.dll
 #endif
 @RESPATH@/components/accessibility.xpt
 #endif
 @RESPATH@/components/alerts.xpt
 @RESPATH@/components/appshell.xpt
@@ -295,17 +291,16 @@
 @RESPATH@/components/saxparser.xpt
 @RESPATH@/components/services-crypto-component.xpt
 @RESPATH@/components/shellservice.xpt
 @RESPATH@/components/shistory.xpt
 @RESPATH@/components/smile.xpt
 @RESPATH@/components/spellchecker.xpt
 @RESPATH@/components/startupcache.xpt
 @RESPATH@/components/storage.xpt
-@RESPATH@/components/@DLL_PREFIX@suite@DLL_SUFFIX@
 @RESPATH@/components/SuiteBrowser.manifest
 @RESPATH@/components/suitecommon.xpt
 @RESPATH@/components/SuiteCommon.manifest
 @RESPATH@/components/suitefeeds.xpt
 @RESPATH@/components/SuiteFeeds.manifest
 @RESPATH@/components/suitemigration.xpt
 @RESPATH@/components/telemetry.xpt
 @RESPATH@/components/toolkit_asyncshutdown.xpt
--- a/suite/profile/migration/src/nsNetscapeProfileMigratorBase.cpp
+++ b/suite/profile/migration/src/nsNetscapeProfileMigratorBase.cpp
@@ -28,16 +28,17 @@
 #define MAIL_DIR_50_NAME             NS_LITERAL_STRING("Mail")
 #define IMAP_MAIL_DIR_50_NAME        NS_LITERAL_STRING("ImapMail")
 #define NEWS_DIR_50_NAME             NS_LITERAL_STRING("News")
 #define DIR_NAME_CHROME              NS_LITERAL_STRING("chrome")
 
 NS_IMPL_ISUPPORTS(nsNetscapeProfileMigratorBase, nsISuiteProfileMigrator,
                    nsITimerCallback)
 
+using namespace mozilla;
 
 ///////////////////////////////////////////////////////////////////////////////
 // nsITimerCallback
 
 NS_IMETHODIMP
 nsNetscapeProfileMigratorBase::Notify(nsITimer *timer)
 {
   CopyNextFolder();
--- a/suite/profile/migration/src/nsNetscapeProfileMigratorBase.h
+++ b/suite/profile/migration/src/nsNetscapeProfileMigratorBase.h
@@ -3,17 +3,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef netscapeprofilemigratorbase___h___
 #define netscapeprofilemigratorbase___h___
 
 #include "nsIFile.h"
 #include "nsIMutableArray.h"
-#include "nsStringAPI.h"
 #include "nsTArray.h"
 #include "nsITimer.h"
 #include "nsIObserverService.h"
 #include "nsISuiteProfileMigrator.h"
 
 class nsIPrefBranch;
 class nsIPrefService;
 
--- a/suite/profile/migration/src/nsSuiteProfileMigratorUtils.cpp
+++ b/suite/profile/migration/src/nsSuiteProfileMigratorUtils.cpp
@@ -18,16 +18,18 @@
 
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsIRDFService.h"
 #include "nsIStringBundle.h"
 #include "nsCRT.h"
 
 #define MIGRATION_BUNDLE "chrome://communicator/migration/locale/migration.properties"
 
+using namespace mozilla;
+
 void SetUnicharPref(const char* aPref, const nsAString& aValue,
                     nsIPrefBranch* aPrefs)
 {
   nsCOMPtr<nsISupportsString> supportsString =
     do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID);
   if (supportsString) {
      supportsString->SetData(aValue);
      aPrefs->SetComplexValue(aPref, NS_GET_IID(nsISupportsString),
@@ -125,66 +127,14 @@ GetProfilePath(nsIProfileStartup* aStart
     if (dirSvc) {
       dirSvc->Get(NS_APP_USER_PROFILE_50_DIR, NS_GET_IID(nsIFile),
                   (void**)aProfileDir);
     }
   }
 }
 
 nsresult
-AnnotatePersonalToolbarFolder(nsIFile* aSourceBookmarksFile,
-                              nsIFile* aTargetBookmarksFile,
-                              const char* aToolbarFolderName)
-{
-  nsCOMPtr<nsIInputStream> fileInputStream;
-  nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(fileInputStream),
-                                           aSourceBookmarksFile);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIOutputStream> outputStream;
-  rv = NS_NewLocalFileOutputStream(getter_AddRefs(outputStream),
-                                   aTargetBookmarksFile);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsILineInputStream> lineInputStream =
-    do_QueryInterface(fileInputStream, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsAutoCString sourceBuffer;
-  nsAutoCString targetBuffer;
-  bool moreData = false;
-  uint32_t bytesWritten = 0;
-  do {
-    lineInputStream->ReadLine(sourceBuffer, &moreData);
-    if (!moreData)
-      break;
-
-    int32_t nameOffset = sourceBuffer.Find(aToolbarFolderName);
-    if (nameOffset >= 0) {
-      // Found the personal toolbar name on a line, check to make sure it's
-      // actually a folder.
-      NS_NAMED_LITERAL_CSTRING(folderPrefix, "<DT><H3 ");
-      int32_t folderPrefixOffset = sourceBuffer.Find(folderPrefix);
-      if (folderPrefixOffset >= 0)
-        sourceBuffer.Insert(
-          NS_LITERAL_CSTRING("PERSONAL_TOOLBAR_FOLDER=\"true\" "),
-          folderPrefixOffset + folderPrefix.Length());
-    }
-
-    targetBuffer.Assign(sourceBuffer);
-    targetBuffer.Append("\r\n");
-    outputStream->Write(targetBuffer.get(), targetBuffer.Length(),
-                        &bytesWritten);
-  }
-  while (1);
-
-  outputStream->Close();
-
-  return NS_OK;
-}
-
-nsresult
 ImportBookmarksHTML(nsIFile* aBookmarksFile,
                     const char16_t* aImportSourceNameKey)
 {
   // XXX: need to make this work with places
   return NS_OK;
 }
--- a/suite/profile/migration/src/nsSuiteProfileMigratorUtils.h
+++ b/suite/profile/migration/src/nsSuiteProfileMigratorUtils.h
@@ -23,17 +23,17 @@
     rv = func(replace); \
     NOTIFY_OBSERVERS(MIGRATION_ITEMAFTERMIGRATE, index.get()); \
   }
 
 #define NC_URI(property) \
   NS_LITERAL_CSTRING("http://home.netscape.com/NC-rdf#"#property)
 
 
-#include "nsStringAPI.h"
+#include "nsString.h"
 #include "nscore.h"
 #include "nsCOMPtr.h"
 
 class nsIPrefBranch;
 class nsIProfileStartup;
 class nsIFile;
 
 void SetUnicharPref(const char* aPref, const nsAString& aValue,
@@ -58,24 +58,15 @@ void GetMigrateDataFromArray(MigrationDa
                              uint16_t* aResult);
 
 
 // get the base directory of the *target* profile
 // this is already cloned, modify it to your heart's content
 void GetProfilePath(nsIProfileStartup* aStartup,
                     nsIFile** aProfileDir);
 
-// The Netscape Bookmarks Format (bookmarks.html) is fairly standard but
-// each browser vendor seems to have their own way of identifying the
-// Personal Toolbar Folder. This function scans for the vendor-specific
-// name in the source Bookmarks file and then writes out a normalized
-// variant into the target folder.
-nsresult AnnotatePersonalToolbarFolder(nsIFile* aSourceBookmarksFile,
-                                       nsIFile* aTargetBookmarksFile,
-                                       const char* aToolbarFolderName);
-
 // In-place import from aBookmarksFile into a folder in the user's bookmarks
 // with the name "From (STR:aImportSourceNameKey)" (aImportSourceNameKey
 // is a key into migration.properties with the pretty name of the application.
 nsresult ImportBookmarksHTML(nsIFile* aBookmarksFile,
                              const char16_t* aImportSourceNameKey);
 
 #endif
--- a/suite/profile/migration/src/nsThunderbirdProfileMigrator.h
+++ b/suite/profile/migration/src/nsThunderbirdProfileMigrator.h
@@ -5,17 +5,16 @@
 
 #ifndef ThunderbirdProfileMigrator_h__
 #define ThunderbirdProfileMigrator_h__
 
 #include "nsISuiteProfileMigrator.h"
 #include "nsIFile.h"
 #include "nsIObserverService.h"
 #include "nsNetscapeProfileMigratorBase.h"
-#include "nsStringAPI.h"
 #include "nsITimer.h"
 #include "mozilla/Attributes.h"
 
 class nsIFile;
 class nsIPrefBranch;
 class nsIPrefService;
 
 #define NS_THUNDERBIRDPROFILEMIGRATOR_CID \
--- a/suite/profile/moz.build
+++ b/suite/profile/moz.build
@@ -11,12 +11,8 @@ DIRS += [
 SOURCES += [
     'nsSuiteDirectoryProvider.cpp',
 ]
 
 FINAL_LIBRARY = 'suite'
 
 JAR_MANIFESTS += ['jar.mn']
 
-USE_LIBS += [
-    'nspr',
-    'xul',
-]
--- a/suite/profile/nsSuiteDirectoryProvider.h
+++ b/suite/profile/nsSuiteDirectoryProvider.h
@@ -4,25 +4,21 @@
 
 #ifndef SuiteDirectoryProvider_h__
 #define SuiteDirectoryProvider_h__
 
 #include "nsCOMArray.h"
 #include "nsIDirectoryService.h"
 #include "nsIFile.h"
 #include "nsISimpleEnumerator.h"
-#include "nsStringAPI.h"
+#include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nsIProperties.h"
 #include "mozilla/Attributes.h"
-
-#define NS_SUITEDIRECTORYPROVIDER_CONTRACTID "@mozilla.org/suite/directory-provider;1"
-// {9aa21826-9d1d-433d-8c10-f313b26fa9dd}
-#define NS_SUITEDIRECTORYPROVIDER_CID \
-  { 0x9aa21826, 0x9d1d, 0x433d, { 0x8c, 0x10, 0xf3, 0x13, 0xb2, 0x6f, 0xa9, 0xdd } }
+#include "nsSuiteCID.h"
 
 #define NS_APP_BOOKMARKS_50_FILE "BMarks"
 
 class nsSuiteDirectoryProvider final : public nsIDirectoryServiceProvider2
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDIRECTORYSERVICEPROVIDER
--- a/suite/shell/src/nsGNOMEShellService.cpp
+++ b/suite/shell/src/nsGNOMEShellService.cpp
@@ -1,39 +1,47 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+#include "mozilla/ArrayUtils.h"
 
 #include "nsCOMPtr.h"
-#include "nsComponentManagerUtils.h"
+#include "nsGNOMEShellService.h"
+#include "nsShellService.h"
+#include "nsIServiceManager.h"
+#include "nsIFile.h"
+#include "nsIProperties.h"
 #include "nsDirectoryServiceDefs.h"
-#include "nsDirectoryServiceUtils.h"
-#include "nsGNOMEShellService.h"
-#include "nsServiceManagerUtils.h"
-#include "nsIGSettingsService.h"
+#include "nsIPrefService.h"
+#include "prenv.h"
+#include "nsString.h"
 #include "nsIGConfService.h"
 #include "nsIGIOService.h"
-#include "nsIPrefService.h"
+#include "nsIGSettingsService.h"
 #include "nsIStringBundle.h"
+#include "nsIOutputStream.h"
+#include "nsIProcess.h"
+#include "nsServiceManagerUtils.h"
+#include "nsComponentManagerUtils.h"
+#include "nsIDOMHTMLImageElement.h"
 #include "nsIImageLoadingContent.h"
-#include "nsIDOMElement.h"
 #include "imgIRequest.h"
 #include "imgIContainer.h"
+#include "mozilla/Sprintf.h"
 #include "nsIImageToPixbuf.h"
-#include "nsIFile.h"
-#include "nsIProcess.h"
-#include "prenv.h"
-#include "mozilla/ArrayUtils.h"
 #include "nsXULAppAPI.h"
+
 #include <glib.h>
 #include <glib-object.h>
 #include <gtk/gtk.h>
 #include <gdk/gdk.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
+#include <limits.h>
+#include <stdlib.h>
 
 // GConf registry key constants
 #define DG_BACKGROUND "/desktop/gnome/background"
 
 #define DGB_OPTIONS DG_BACKGROUND "/picture_options"
 #define DGB_IMAGE DG_BACKGROUND "/picture_filename"
 #define DGB_DRAWBG DG_BACKGROUND "/draw_background"
 #define DGB_COLOR DG_BACKGROUND "/primary_color"
--- a/suite/shell/src/nsGNOMEShellService.h
+++ b/suite/shell/src/nsGNOMEShellService.h
@@ -4,19 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsgnomeshellservice_h____
 #define nsgnomeshellservice_h____
 
 #include "nsShellService.h"
 #include "nsStringGlue.h"
 #include "mozilla/Attributes.h"
-
-#define NS_SUITEGNOMEINTEGRATION_CID \
-{0xc16cfa25, 0xa74a, 0x420b, {0xa5, 0x45, 0x4b, 0xc0, 0x6b, 0x08, 0xa8, 0x65}}
+#include "nsSuiteCID.h"
 
 struct ProtocolAssociation;
 
 class nsGNOMEShellService final : public nsIShellService
 {
 public:
   nsGNOMEShellService() : mCheckedThisSessionClient(false) { }
 
--- a/suite/shell/src/nsMacShellService.cpp
+++ b/suite/shell/src/nsMacShellService.cpp
@@ -1,35 +1,33 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsCOMPtr.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMHTMLImageElement.h"
 #include "nsIImageLoadingContent.h"
 #include "nsIDocument.h"
 #include "nsIContent.h"
 #include "nsILocalFileMac.h"
 #include "nsIObserverService.h"
 #include "nsIPrefService.h"
 #include "nsIServiceManager.h"
 #include "nsIStringBundle.h"
 #include "nsIURL.h"
 #include "nsIWebBrowserPersist.h"
 #include "nsMacShellService.h"
-#include "nsNetUtil.h"
+#include "nsIProperties.h"
+#include "nsServiceManagerUtils.h"
 #include "nsShellService.h"
-#include "nsStringAPI.h"
+#include "nsString.h"
 #include "nsIDocShell.h"
 #include "nsILoadContext.h"
-#include "nsIProperties.h"
-#include "nsServiceManagerUtils.h"
 
 #include <ApplicationServices/ApplicationServices.h>
 
 #define SAFARI_BUNDLE_IDENTIFIER "com.apple.Safari"
 
 NS_IMPL_ISUPPORTS(nsMacShellService, nsIShellService, nsIWebProgressListener)
 
 NS_IMETHODIMP
--- a/suite/shell/src/nsMacShellService.h
+++ b/suite/shell/src/nsMacShellService.h
@@ -6,22 +6,20 @@
 #ifndef nsmacshellservice_h____
 #define nsmacshellservice_h____
 
 #include "nsShellService.h"
 #include "nsIWebProgressListener.h"
 #include "nsIFile.h"
 #include "nsCOMPtr.h"
 #include "mozilla/Attributes.h"
+#include "nsSuiteCID.h"
 
 #include <CoreFoundation/CoreFoundation.h>
 
-#define NS_SUITEMACINTEGRATION_CID \
-{0xac17e6f0, 0x50c9, 0x4901, {0xab, 0x08, 0xf8, 0x70, 0xbf, 0xcd, 0x12, 0xce}}
-
 class nsMacShellService final : public nsIShellService,
                                 public nsIWebProgressListener
 {
 public:
   nsMacShellService() : mCheckedThisSessionClient(false) {};
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSISHELLSERVICE
--- a/suite/shell/src/nsShellService.h
+++ b/suite/shell/src/nsShellService.h
@@ -4,10 +4,8 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIShellService.h"
 
 #define PREF_CHECKDEFAULTCLIENT "shell.checkDefaultClient"
 
 #define SHELLSERVICE_PROPERTIES "chrome://communicator/locale/shellservice.properties"
 #define BRAND_PROPERTIES "chrome://branding/locale/brand.properties"
-
-#define NS_SUITESHELLSERVICE_CONTRACTID "@mozilla.org/suite/shell-service;1"
--- a/suite/shell/src/nsWindowsShellService.cpp
+++ b/suite/shell/src/nsWindowsShellService.cpp
@@ -1,40 +1,46 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#include "nsWindowsShellService.h"
+
 #include "imgIContainer.h"
 #include "imgIRequest.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/RefPtr.h"
+#include "nsIDOMElement.h"
 #include "nsIDOMHTMLImageElement.h"
 #include "nsIImageLoadingContent.h"
+#include "nsIOutputStream.h"
 #include "nsIPrefService.h"
 #include "nsIPrefLocalizedString.h"
-#include "nsWindowsShellService.h"
-#include "nsIProcess.h"
-#include "windows.h"
-#include "nsIFile.h"
+#include "nsIServiceManager.h"
+#include "nsIStringBundle.h"
 #include "nsNetUtil.h"
-#include "nsNativeCharsetUtils.h"
-#include "nsUnicharUtils.h"
-#include "nsIStringBundle.h"
-#include "nsIServiceManager.h"
 #include "nsServiceManagerUtils.h"
+#include "nsShellService.h"
+#include "nsIProcess.h"
+#include "nsICategoryManager.h"
+#include "nsDirectoryServiceUtils.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDirectoryServiceDefs.h"
-#include "nsDirectoryServiceUtils.h"
 #include "nsIWindowsRegKey.h"
+#include "nsUnicharUtils.h"
 #include "nsIWinTaskbar.h"
 #include "nsISupportsPrimitives.h"
+#include "nsIURLFormatter.h"
+#include "nsThreadUtils.h"
 #include "nsXULAppAPI.h"
-#include <mbstring.h>
-#include "mozilla/Services.h"
+#include "mozilla/WindowsVersion.h"
+
+#include "windows.h"
+#include "shellapi.h"
 
 #ifdef _WIN32_WINNT
 #undef _WIN32_WINNT
 #endif
 #define _WIN32_WINNT 0x0600
 #define INITGUID
 #include <shlobj.h>
 
--- a/suite/shell/src/nsWindowsShellService.h
+++ b/suite/shell/src/nsWindowsShellService.h
@@ -1,24 +1,22 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nscore.h"
 #include "nsShellService.h"
-#include "nsStringGlue.h"
+#include "nsString.h"
 #include "nsIWindowsShellService.h"
 #include "mozilla/Attributes.h"
+#include "nsSuiteCID.h"
 
 #include <windows.h>
 
-#define NS_SUITEWININTEGRATION_CID \
-{0x39b688ec, 0xe308, 0x49e5, {0xbe, 0x6b, 0x28, 0xdc, 0x7f, 0xcd, 0x61, 0x54}}
-
 typedef struct {
   const char* keyName;
   const char* valueName;
   const char* valueData;
 
   int32_t flags;
 } SETTING;