Bug 389671 - CVS remove old suite-style multi-profile code which is not used anymore, r=luser (NPOB except for removing build-system references to files/options)
authorbenjamin@smedbergs.us
Thu, 02 Aug 2007 11:43:30 -0700
changeset 4172 ade2d0545d8c96a0d4b2e3f47fce1d684e3a1d6c
parent 4171 f1c03adb7f58fcc719ea2e6d8280e148a13fc983
child 4173 3e1f7fc3abf2b81c5db6c807dd77e2f09b6c38d1
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluser
bugs389671
milestone1.9a7pre
Bug 389671 - CVS remove old suite-style multi-profile code which is not used anymore, r=luser (NPOB except for removing build-system references to files/options)
allmakefiles.sh
config/autoconf.mk.in
configure.in
netwerk/confvars.sh
profile/Makefile.in
profile/build/Makefile.in
profile/build/nsProfileFactory.cpp
profile/build/profile.pkg
profile/defaults/Makefile.in
profile/defaults/bookmarks.html
profile/defaults/chrome/Makefile.in
profile/defaults/chrome/userChrome-example.css
profile/defaults/chrome/userContent-example.css
profile/defaults/localstore.rdf
profile/defaults/mimeTypes.rdf
profile/defaults/panels.rdf
profile/defaults/profiledef.pkg
profile/defaults/search.rdf
profile/pref-migrator/Makefile.in
profile/pref-migrator/public/Makefile.in
profile/pref-migrator/public/idl/guid_list.txt
profile/pref-migrator/public/idl/prefm.idl
profile/pref-migrator/public/nsIPrefMigration.idl
profile/pref-migrator/public/nsIPrefMigrationProgress.idl
profile/pref-migrator/resources/Makefile.in
profile/pref-migrator/resources/content/profileMigrationProgress.js
profile/pref-migrator/resources/content/profileMigrationProgress.xul
profile/pref-migrator/resources/jar.mn
profile/pref-migrator/resources/locale/en-US/profileMigrationProgress.dtd
profile/public/Makefile.in
profile/public/nsIProfileInternal.idl
profile/public/nsIProfileStartupListener.idl
profile/public/nsISessionRoaming.idl
profile/resources/Makefile.in
profile/resources/content/createProfileWizard.js
profile/resources/content/createProfileWizard.xul
profile/resources/content/migrateAllProfile.xul
profile/resources/content/profileManager.js
profile/resources/content/profileSelection.js
profile/resources/content/profileSelection.xul
profile/resources/content/selectLang.js
profile/resources/content/selectLang.xul
profile/resources/jar.mn
profile/resources/locale/en-US/createProfileWizard.dtd
profile/resources/locale/en-US/migrateAllProfile.dtd
profile/resources/locale/en-US/migration.properties
profile/resources/locale/en-US/profileManager.properties
profile/resources/locale/en-US/profileManagerMigrateAll.dtd
profile/resources/locale/en-US/profileSelection.dtd
profile/resources/locale/en-US/selectLang.dtd
profile/src/Makefile.in
profile/src/nsProfile.cpp
profile/src/nsProfile.h
profile/src/nsProfileAccess.cpp
profile/src/nsProfileAccess.h
toolkit/xre/nsNativeAppSupportOS2.cpp
toolkit/xre/nsNativeAppSupportWin.cpp
--- a/allmakefiles.sh
+++ b/allmakefiles.sh
@@ -479,24 +479,17 @@ fi
 MAKEFILES_uriloader="
 uriloader/Makefile
 uriloader/base/Makefile
 uriloader/exthandler/Makefile
 "
 
 MAKEFILES_profile="
 profile/Makefile
-profile/src/Makefile
 profile/public/Makefile
-profile/resources/Makefile
-profile/pref-migrator/Makefile
-profile/pref-migrator/public/Makefile
-profile/pref-migrator/src/Makefile
-profile/pref-migrator/resources/Makefile
-profile/defaults/Makefile
 profile/dirserviceprovider/Makefile
 profile/dirserviceprovider/public/Makefile
 profile/dirserviceprovider/src/Makefile
 "
 
 MAKEFILES_rdf="
 rdf/Makefile
 rdf/base/Makefile
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -120,17 +120,16 @@ ENABLE_TESTS	= @ENABLE_TESTS@
 IBMBIDI = @IBMBIDI@
 MOZ_UNIVERSALCHARDET = @MOZ_UNIVERSALCHARDET@
 SUNCTL = @SUNCTL@
 ACCESSIBILITY = @ACCESSIBILITY@
 MOZ_VIEW_SOURCE = @MOZ_VIEW_SOURCE@
 MOZ_XPINSTALL = @MOZ_XPINSTALL@
 MOZ_JSLOADER  = @MOZ_JSLOADER@
 MOZ_USE_NATIVE_UCONV = @MOZ_USE_NATIVE_UCONV@
-MOZ_SINGLE_PROFILE = @MOZ_SINGLE_PROFILE@
 MOZ_LDAP_XPCOM = @MOZ_LDAP_XPCOM@
 MOZ_LDAP_XPCOM_EXPERIMENTAL = @MOZ_LDAP_XPCOM_EXPERIMENTAL@
 MOZ_BRANDING_DIRECTORY = @MOZ_BRANDING_DIRECTORY@
 XPCOM_USE_LEA = @XPCOM_USE_LEA@
 JS_ULTRASPARC_OPTS = @JS_ULTRASPARC_OPTS@
 JS_STATIC_BUILD = @JS_STATIC_BUILD@
 MOZ_ENABLE_POSTSCRIPT = @MOZ_ENABLE_POSTSCRIPT@
 MOZ_INSTALLER	= @MOZ_INSTALLER@
--- a/configure.in
+++ b/configure.in
@@ -4101,17 +4101,16 @@ MOZ_PYTHON_DLL_SUFFIX=
 MOZ_PYTHON_INCLUDES=
 MOZ_PYTHON_LIBS=
 MOZ_PYTHON_PREFIX=
 MOZ_PYTHON_VER=
 MOZ_PYTHON_VER_DOTTED=
 MOZ_RDF=1
 MOZ_REFLOW_PERF=
 MOZ_SAFE_BROWSING=
-MOZ_SINGLE_PROFILE=
 MOZ_SPELLCHECK=1
 MOZ_STATIC_MAIL_BUILD=
 MOZ_STORAGE=1
 MOZ_SVG=1
 MOZ_TIMELINE=
 MOZ_UI_LOCALE=en-US
 MOZ_UNIVERSALCHARDET=1
 MOZ_URL_CLASSIFIER=
@@ -4229,17 +4228,16 @@ basic)
   MOZ_NO_XPCOM_OBSOLETE=1
   MOZ_NO_FAST_LOAD=1
   MOZ_OJI=
   MOZ_PLAINTEXT_EDITOR_ONLY=1
 #  MOZ_PLUGINS=
   MOZ_PREF_EXTENSIONS=
   MOZ_PROFILELOCKING=
   MOZ_PROFILESHARING=
-  MOZ_SINGLE_PROFILE=1
   MOZ_SPELLCHECK=
   MOZ_SVG=
   MOZ_UNIVERSALCHARDET=
   MOZ_UPDATER=
   MOZ_USE_NATIVE_UCONV=1
   MOZ_VIEW_SOURCE=
   MOZ_XPFE_COMPONENTS=
   MOZ_XPINSTALL=
@@ -4277,17 +4275,16 @@ minimal)
   MOZ_NO_XPCOM_OBSOLETE=1
   MOZ_NO_FAST_LOAD=1
   MOZ_OJI=
   MOZ_PLAINTEXT_EDITOR_ONLY=1
   MOZ_PLUGINS=
   MOZ_PREF_EXTENSIONS=
   MOZ_PROFILELOCKING=
   MOZ_PROFILESHARING=
-  MOZ_SINGLE_PROFILE=1
   MOZ_SPELLCHECK=
   MOZ_STORAGE=
   MOZ_SVG=
   MOZ_UNIVERSALCHARDET=
   MOZ_UPDATER=
   MOZ_USE_NATIVE_UCONV=1
   MOZ_VIEW_SOURCE=
   MOZ_XPFE_COMPONENTS=
@@ -4403,17 +4400,16 @@ AC_SUBST(MOZ_PHOENIX)
 AC_SUBST(MOZ_THUNDERBIRD)
 AC_SUBST(MOZ_STANDALONE_COMPOSER)
 AC_SUBST(MOZ_SUNBIRD)
 AC_SUBST(MOZ_XULRUNNER)
 
 AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
 
 if test "$MOZ_XUL_APP"; then
-  MOZ_SINGLE_PROFILE=1
   MOZ_PROFILESHARING=
   AC_DEFINE(MOZ_XUL_APP)
 fi
 
 dnl ========================================================
 dnl = 
 dnl = Toolkit Options
 dnl = 
@@ -5090,24 +5086,16 @@ MOZ_ARG_DISABLE_BOOL(xpinstall,
 [  --disable-xpinstall     Disable xpinstall support],
     MOZ_XPINSTALL=,
     MOZ_XPINSTALL=1 )
 if test "$MOZ_XPINSTALL"; then
     AC_DEFINE(MOZ_XPINSTALL)
 fi
 
 dnl ========================================================
-dnl Single profile support off by default
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(single-profile,
-[  --enable-single-profile Enable single profile support ],
-    MOZ_SINGLE_PROFILE=1,
-    MOZ_SINGLE_PROFILE= )
-
-dnl ========================================================
 dnl xpcom js loader support on by default
 dnl ========================================================
 MOZ_ARG_DISABLE_BOOL(jsloader,
 [  --disable-jsloader      Disable xpcom js loader support],
     MOZ_JSLOADER=,
     MOZ_JSLOADER=1 )
 if test "$MOZ_JSLOADER"; then
     AC_DEFINE(MOZ_JSLOADER)
@@ -5168,19 +5156,16 @@ dnl ====================================
 dnl = Drop XPCOM Obsolete library
 dnl ========================================================
 MOZ_ARG_DISABLE_BOOL(xpcom-obsolete,
 [  --disable-xpcom-obsolete           Disable XPCOM Obsolete Library],
     MOZ_NO_XPCOM_OBSOLETE=1,
     MOZ_NO_XPCOM_OBSOLETE=)
 
 if test -n "$MOZ_NO_XPCOM_OBSOLETE"; then
-if test -z "$MOZ_SINGLE_PROFILE"; then
-    AC_MSG_ERROR([Building without xpcom-obsolete isn't support when building full profile support.])
-fi
     AC_DEFINE(MOZ_NO_XPCOM_OBSOLETE)
 fi
 
 dnl ========================================================
 dnl = Disable Fast Load
 dnl ========================================================
 MOZ_ARG_DISABLE_BOOL(xpcom-fastload,
 [  --disable-xpcom-fastload           Disable XPCOM fastload support],
@@ -7474,17 +7459,16 @@ AC_SUBST(BUILD_STATIC_LIBS)
 AC_SUBST(MOZ_ENABLE_LIBXUL)
 AC_SUBST(ENABLE_TESTS)
 AC_SUBST(IBMBIDI)
 AC_SUBST(SUNCTL)
 AC_SUBST(MOZ_UNIVERSALCHARDET)
 AC_SUBST(ACCESSIBILITY)
 AC_SUBST(MOZ_XPINSTALL)
 AC_SUBST(MOZ_VIEW_SOURCE)
-AC_SUBST(MOZ_SINGLE_PROFILE)
 AC_SUBST(MOZ_SPELLCHECK)
 AC_SUBST(MOZ_XPFE_COMPONENTS)
 AC_SUBST(MOZ_USER_DIR)
 AC_SUBST(MOZ_AIRBAG)
 AC_SUBST(MOZ_MOCHITEST)
 
 AC_SUBST(ENABLE_STRIP)
 AC_SUBST(USE_ELF_DYNSTR_GC)
--- a/netwerk/confvars.sh
+++ b/netwerk/confvars.sh
@@ -35,11 +35,10 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 MOZ_APP_NAME=mozilla
 MOZ_EXTENSIONS_DEFAULT=""
 MOZ_APP_VERSION=$MOZILLA_VERSION
 MOZ_NO_XPCOM_OBSOLETE=1
-MOZ_SINGLE_PROFILE=1
 MOZ_PROFILESHARING=
 MOZ_XPINSTALL=
--- a/profile/Makefile.in
+++ b/profile/Makefile.in
@@ -41,14 +41,10 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= profile
 
 DIRS		= public dirserviceprovider 
 
-ifndef MOZ_SINGLE_PROFILE
-DIRS            += src build resources defaults pref-migrator
-endif
-
 include $(topsrcdir)/config/rules.mk
 
deleted file mode 100644
--- a/profile/build/Makefile.in
+++ /dev/null
@@ -1,86 +0,0 @@
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 2002
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# 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 *****
-
-DEPTH		= ../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE		= profile
-LIBRARY_NAME	= profile
-EXPORT_LIBRARY  = 1
-IS_COMPONENT	= 1
-MODULE_NAME	= nsProfileModule
-MOZILLA_INTERNAL_API = 1
-
-PACKAGE_FILE = profile.pkg
-
-REQUIRES	= xpcom \
-		  xpcom_obsolete \
-		  string \
-		  uriloader \
-		  appshell \
-		  appcomps \
-		  $(NULL)
-
-CPPSRCS		= \
-			nsProfileFactory.cpp	\
-			$(NULL)
-SHARED_LIBRARY_LIBS = \
-		../src/$(LIB_PREFIX)profile_s.$(LIB_SUFFIX) \
-		../dirserviceprovider/src/$(LIB_PREFIX)profdirserviceprovider_s.$(LIB_SUFFIX) \
-		$(NULL)
-
-EXTRA_DSO_LDOPTS = \
-		$(LIBS_DIR) \
-		$(XPCOM_LIBS) \
-		$(MOZ_XPCOM_OBSOLETE_LIBS) \
-		$(MOZ_JS_LIBS) \
-		$(NSPR_LIBS) \
-		$(NULL)
-
-ifeq (,$(filter-out mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
-EXTRA_DSO_LDOPTS += $(TK_LIBS)
-endif
-
-include $(topsrcdir)/config/rules.mk
-
-LOCAL_INCLUDES	= \
-		-I$(srcdir)/../src \
-		$(NULL)
-
deleted file mode 100644
--- a/profile/build/nsProfileFactory.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Conrad Carlen <ccarlen@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * 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 ***** */
-
-#include "nsProfile.h"
-#include "nsIModule.h"
-#include "nsIGenericFactory.h"
-
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsProfile, Init)
-
-static const nsModuleComponentInfo components[] =
-{
-    { "Profile Manager", 
-      NS_PROFILE_CID,
-      NS_PROFILE_CONTRACTID, 
-      nsProfileConstructor,
-    },
-};
-
-NS_IMPL_NSGETMODULE(nsProfileModule, components)
deleted file mode 100644
--- a/profile/build/profile.pkg
+++ /dev/null
@@ -1,7 +0,0 @@
-[gecko]
-#if SHARED_LIBRARY
-dist/bin/components/@SHARED_LIBRARY@
-#else
-!staticcomp @LIBRARY@ @MODULE_NAME@
-#endif
-!xpt dist/bin/components/profile.xpt
deleted file mode 100644
--- a/profile/defaults/Makefile.in
+++ /dev/null
@@ -1,68 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either of the GNU General Public License Version 2 or later (the "GPL"),
-# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# 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 *****
-
-DEPTH		= ../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE       = profile
-PACKAGE_FILE = profiledef.pkg
-
-DIRS		= chrome
-
-include $(topsrcdir)/config/rules.mk
-
-FILES := \
-	bookmarks.html \
-	panels.rdf \
-	localstore.rdf \
-	search.rdf \
-	mimeTypes.rdf \
-	$(NULL)
-
-libs:: $(FILES)
-	$(INSTALL) $^ $(DIST)/bin/defaults/profile
-	$(INSTALL) $^ $(DIST)/bin/defaults/profile/$(AB_CD)
-
-install:: $(FILES)
-	$(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/defaults/profile
-	$(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/defaults/profile/$(AB_CD)
-
-
deleted file mode 100644
--- a/profile/defaults/bookmarks.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE NETSCAPE-Bookmark-file-1>
-<!-- This is an automatically generated file.
-It will be read and overwritten.
-Do Not Edit! -->
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
-<TITLE>Bookmarks</TITLE>
-<H1>Bookmarks</H1>
-
-<DL><p>
-    <DT><H3 PERSONAL_TOOLBAR_FOLDER="true" ID="NC:PersonalToolbarFolder">Personal Toolbar Folder</H3>
-    <DL><p>
-        <DT><A HREF="http://www.mozilla.org/">mozilla.org</A>
-        <DT><A HREF="http://www.mozillazine.org/">mozillaZine</A>
-        <DT><A HREF="http://www.mozdev.org/">mozdev.org</A>
-    </DL><p>
-    <DT><H3>Mozilla Project</H3>
-    <DL><p>
-        <DT><H3>mozilla.org</H3>
-        <DL><p>
-            <DT><A HREF="http://www.mozilla.org/">The Mozilla Organization</A>
-            <DT><A HREF="http://www.mozilla.org/projects/seamonkey/">SeaMonkey Project</a>
-            <DT><A HREF="http://www.mozilla.org/products/">Mozilla Products</A>
-            <DT><A HREF="http://www.mozilla.org/feedback.html">Feedback</A>
-        </DL><p>
-        <DT><H3>Community & Support</H3>
-        <DL><p>
-            <DT><A HREF="http://www.mozillazine.org/">mozillaZine</A>
-            <DT><A HREF="http://forums.mozillazine.org/viewforum.php?f=40">SeaMonkey Support (mozillaZine)</A>
-            <DT><A HREF="http://www.mozdev.org/">mozdev.org</A>
-            <DT><A HREF="http://plugindoc.mozdev.org/">Mozilla Plug-in Information (mozdev)</A>
-            <DT><A HREF="http://extensionroom.mozdev.org/">Mozilla Extensions (mozdev)</A>
-        </DL><p>
-    </DL><p>
-    <DT><H3>Search the Web</H3>
-    <DL><p>
-        <DT><A HREF="http://www.google.com/">Google</A>
-        <DT><A HREF="http://groups.google.com/">Google Groups</A>
-        <DT><A HREF="http://news.google.com/">Google News</A>
-    </DL><p>
-    <HR>
-</DL><p>
deleted file mode 100644
--- a/profile/defaults/chrome/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 2001
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either of the GNU General Public License Version 2 or later (the "GPL"),
-# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# 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 *****
-
-DEPTH		= ../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-include $(topsrcdir)/config/rules.mk
-
-FILES := \
-	userContent-example.css \
-	userChrome-example.css \
-	$(NULL)
-
-FILES := $(addprefix $(srcdir)/, $(FILES))
-
-libs::
-	$(INSTALL) $(FILES) $(DIST)/bin/defaults/profile/chrome
-	$(INSTALL) $(FILES) $(DIST)/bin/defaults/profile/$(AB_CD)/chrome
-
-install::
-	$(SYSINSTALL) $(IFLAGS1) $(FILES) $(DESTDIR)$(mozappdir)/defaults/profile/chrome
-	$(NSINSTALL)  -t $(IFLAGS1) $(FILES) $(DESTDIR)$(mozappdir)/defaults/profile/$(AB_CD)/chrome
-
deleted file mode 100644
--- a/profile/defaults/chrome/userChrome-example.css
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Edit this file and copy it as userChrome.css into your
- * profile-directory/chrome/
- */
-
-/*
- * This file can be used to customize the look of Mozilla's user interface
- * You should consider using !important on rules which you want to
- * override default settings.
- */
-
-/*
- * Do not remove the @namespace line -- it's required for correct functioning
- */
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
-
-
-/*
- * Some possible accessibility enhancements:
- */
-/*
- * Make all the default font sizes 20 pt:
- *
- * * {
- *   font-size: 20pt !important
- * }
- */
-/*
- * Make menu items in particular 15 pt instead of the default size:
- *
- * menupopup > * {
- *   font-size: 15pt !important
- * }
- */
-/*
- * Give the Location (URL) Bar a fixed-width font
- *
- * #urlbar {
- *    font-family: monospace !important;
- * }
- */
-
-/*
- * Eliminate the throbber and its annoying movement:
- *
- * #throbber-box {
- *   display: none !important;
- * }
- */
-
-/*
- * For more examples see http://www.mozilla.org/unix/customizing.html
- */
- 
deleted file mode 100644
--- a/profile/defaults/chrome/userContent-example.css
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Edit this file and copy it as userContent.css into your
- * profile-directory/chrome/
- */
-
-/*
- * This file can be used to apply a style to all web pages you view
- * Rules without !important are overruled by author rules if the
- * author sets any.  Rules with !important overrule author rules.
- */
-
-/*
- * example: turn off "blink" element blinking
- *
- * blink { text-decoration: none ! important; }
- *
- */
-
-/*
- * example: give all tables a 2px border
- *
- * table { border: 2px solid; }
- */
-
-/*
- * example: turn off "marquee" element
- *
- * marquee { -moz-binding: none; }
- *
- */
-
-/*
- * example: make search fields on www.mozilla.org black-on-white
- *
- * @-moz-document url-prefix(http://www.mozilla.org/) {
- *   #q { background: white ! important; color: black ! important; }
- * }
- */
- 
-/* 
- * For more examples see http://www.mozilla.org/unix/customizing.html
- */
-
deleted file mode 100644
--- a/profile/defaults/localstore.rdf
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0"?>
-<RDF:RDF
-     xmlns:NC="http://home.netscape.com/NC-rdf#"
-     xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
-  <RDF:Description about="chrome://navigator/content/navigator.xul#sidebar-panels">
-    <last-selected-panel>urn:sidebar:panel:bookmarks</last-selected-panel>
-  </RDF:Description>
-  <RDF:Description about="chrome://navigator/content/navigator.xul#sidebar-box">
-    <hidden>true</hidden>
-  </RDF:Description>
-  <RDF:Description about="chrome://navigator/content/navigator.xul#sidebar-splitter">
-    <hidden>true</hidden>
-  </RDF:Description>
-  <RDF:Description about="chrome://navigator/content/navigator.xul">
-    <NC:persist resource="chrome://navigator/content/navigator.xul#sidebar-panels"/>
-    <NC:persist resource="chrome://navigator/content/navigator.xul#sidebar-box"/>
-    <NC:persist resource="chrome://navigator/content/navigator.xul#sidebar-splitter"/>
-  </RDF:Description>
-</RDF:RDF>
deleted file mode 100644
--- a/profile/defaults/mimeTypes.rdf
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0"?>  
-
-<!--
- This file is used as a persistent data store for helper application
- information.
-
- The root of the data is the <RDF:Seq about="urn:mimetypes:root"/>. This
- contains one <RDF:li/> entry per MIME type.  Each <RDF:li/> entry corresponds
- to the "urn:mimetype:major/minor" resource, where "major/minor" is the MIME
- type.  For example, for HTML we would have "urn:mimetype:text/html".
- Typically, this resource will be in the <RDF:Description/> node which has the
- corresponding "about" attribute.
-
- Each "urn:mimetype:major/minor" resource can have the following properties:
-
-   NC:Value - the MIME type string
-   NC:editable - a "true" or "false" depending on whether this entry is
-                 editable
-   NC:description - a description of the type ("HTML Document" for text/html)
-   NC:fileExtensions - there will be one of these properties per extension that
-                       corresponds to this MIME type, each one having a single
-                       extension as its value.
-   NC:handlerProp - the way the type should be handled.  This corresponds to a
-                    "urn:mimetype:handler:major/minor" resource.  Eg, the way
-                    HTML is handled would be stored in the
-                    "urn:mimetype:handler:text/html" resource
-
- Each "urn:mimetype:handler:major/minor" resource can have the following
- properties:
-
-   NC:useSystemDefault - "true" if we should handle per default OS setting,
-                          "false" or not set otherwise
-   NC:saveToDisk - "true" if the data should be saved to disk, "false" or not
-                   set otherwise.
-     (Note - if both of these are false, that means "open in helper app")
-   NC:alwaysAsk - "true" if the user should always be prompted before handling
-                  data of this type, false otherwise.
-   NC:externalApplication - the helper application to use for this type.  This
-                            corresponds to a
-                            "urn:mimetype:externalApplication:major/minor"
-			    resource
-
- Each "urn:mimetype:externalApplication:major/minor" resource can have the
- following properties:
-
-   NC:path - the path to the application
-   NC:prettyName - the "pretty name" of the application ("Acrobat Reader" for
-                   /usr/bin/acroread, eg).
--->
-			
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:NC="http://home.netscape.com/NC-rdf#">
-
-  <RDF:Description about="urn:mimetypes"> 
-    <NC:MIME-types> 
-      <RDF:Seq about="urn:mimetypes:root"> 
-      </RDF:Seq>
-    </NC:MIME-types> 
-  </RDF:Description> 
-</RDF:RDF>
deleted file mode 100644
--- a/profile/defaults/panels.rdf
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0"?> <!-- -*- Mode: SGML -*- -->
-
-<!--
-
-  These are the panels that will be displayed in the sidebar.
-
--->
-<!DOCTYPE RDF SYSTEM "chrome://communicator/locale/sidebar/local-panels.dtd">
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:NC="http://home.netscape.com/NC-rdf#">
-
-  <RDF:Description about="urn:sidebar:current-panel-list">
-    <NC:panel-list>
-      <RDF:Seq>
-        <RDF:li resource="urn:sidebar:panel:search"/>
-        <RDF:li resource="urn:sidebar:panel:bookmarks"/>
-        <RDF:li resource="urn:sidebar:panel:history"/>
-        <RDF:li resource="urn:sidebar:panel:addressbook"/>
-      </RDF:Seq>
-    </NC:panel-list>
-    <NC:version>0.1</NC:version>
-  </RDF:Description>
-  <RDF:Description about="urn:sidebar:panel:search">
-    <NC:title>&sidebar.search.label;</NC:title>
-    <NC:content>chrome://communicator/content/search/search-panel.xul</NC:content>
-  </RDF:Description>
-  <RDF:Description about="urn:sidebar:panel:bookmarks">
-    <NC:title>&sidebar.client-bookmarks.label;</NC:title>
-    <NC:content>chrome://communicator/content/bookmarks/bm-panel.xul</NC:content>
-  </RDF:Description>
-  <RDF:Description about="urn:sidebar:panel:history">
-    <NC:title>&sidebar.client-history.label;</NC:title>
-    <NC:content>chrome://communicator/content/history/history-panel.xul</NC:content>
-  </RDF:Description>
-  <RDF:Description about="urn:sidebar:panel:addressbook">
-    <NC:title>&sidebar.client-addressbook.label;</NC:title>
-    <NC:content>chrome://messenger/content/addressbook/addressbook-panel.xul</NC:content>
-  </RDF:Description>
-</RDF:RDF>
deleted file mode 100644
--- a/profile/defaults/profiledef.pkg
+++ /dev/null
@@ -1,19 +0,0 @@
-[xpfe-default-US]
-dist/bin/defaults/profile/bookmarks.html
-dist/bin/defaults/profile/panels.rdf
-dist/bin/defaults/profile/localstore.rdf
-dist/bin/defaults/profile/search.rdf
-dist/bin/defaults/profile/mimeTypes.rdf
-
-dist/bin/defaults/profile/chrome/userChrome-example.css
-dist/bin/defaults/profile/chrome/userContent-example.css
-
-[xpfe-locale-US]
-dist/bin/defaults/profile/US/bookmarks.html
-dist/bin/defaults/profile/US/panels.rdf
-dist/bin/defaults/profile/US/localstore.rdf
-dist/bin/defaults/profile/US/search.rdf
-dist/bin/defaults/profile/US/mimeTypes.rdf
-
-dist/bin/defaults/profile/US/chrome/userChrome-example.css
-dist/bin/defaults/profile/US/chrome/userContent-example.css
deleted file mode 100644
--- a/profile/defaults/search.rdf
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0"?> <!-- -*- Mode: SGML -*- -->
-<!-- ***** BEGIN LICENSE BLOCK *****
-   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
-   -
-   - The contents of this file are subject to the Mozilla Public License Version
-   - 1.1 (the "License"); you may not use this file except in compliance with
-   - the License. You may obtain a copy of the License at
-   - http://www.mozilla.org/MPL/
-   -
-   - Software distributed under the License is distributed on an "AS IS" basis,
-   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-   - for the specific language governing rights and limitations under the
-   - License.
-   -
-   - The Original Code is Mozilla Communicator.
-   -
-   - The Initial Developer of the Original Code is
-   - Netscape Communications Corp.
-   - Portions created by the Initial Developer are Copyright (C) 1999
-   - the Initial Developer. All Rights Reserved.
-   -
-   - Contributor(s):
-   -   Robert John Churchill (rjc@netscape.com)
-   -
-   - Alternatively, the contents of this file may be used under the terms of
-   - either of the GNU General Public License Version 2 or later (the "GPL"),
-   - or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-   - in which case the provisions of the GPL or the LGPL are applicable instead
-   - of those above. If you wish to allow use of your version of this file only
-   - under the terms of either the GPL or the LGPL, and not to allow others to
-   - use your version of this file under the terms of the MPL, indicate your
-   - decision by deleting the provisions above and replace them with the notice
-   - and other provisions required by the GPL or the LGPL. If you do not delete
-   - 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 ***** -->
-
-
-<!DOCTYPE RDF 
-[
-<!ENTITY search.category.web		"Web">
-]
->
-
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:NC="http://home.netscape.com/NC-rdf#">
-
-
-<!-- search categories (under the "NC:SearchCategoryRoot" node) -->
-<!-- Note: these names SHOULD be localized via a DTD -->
-
-  <RDF:Seq about="NC:SearchCategoryRoot">
-  	<RDF:li>
-  		<RDF:Description about="urn:search:category:1">
-			<NC:title>&search.category.web;</NC:title>
-  		</RDF:Description>
-  	</RDF:li>
-  </RDF:Seq>
-
-
-<!-- engines per category (Note that specific prefixes are required) -->
-
-
-  <RDF:Seq about="NC:SearchCategory?category=urn:search:category:1">
-    <RDF:li resource="NC:SearchCategory?engine=urn:search:engine:google.src" />
-    <RDF:li resource="NC:SearchCategory?engine=urn:search:engine:dmoz.src" />
-    <RDF:li resource="NC:SearchCategory?engine=urn:search:engine:jeeves.src" />
-  </RDF:Seq>
-
-</RDF:RDF>
deleted file mode 100644
--- a/profile/pref-migrator/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either of the GNU General Public License Version 2 or later (the "GPL"),
-# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# 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 *****
-
-DEPTH		= ../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE		= prefmigr
-DIRS		= public src resources
-
-include $(topsrcdir)/config/rules.mk
-
deleted file mode 100644
--- a/profile/pref-migrator/public/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either of the GNU General Public License Version 2 or later (the "GPL"),
-# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# 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 *****
-
-DEPTH		= ../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE		= prefmigr
-
-EXPORTS		= nsPrefMigrationCIDs.h
-
-XPIDLSRCS	= \
-		nsIPrefMigration.idl \
-		nsIPrefMigrationProgress.idl \
-		$(NULL)
-
-include $(topsrcdir)/config/rules.mk
-
deleted file mode 100644
--- a/profile/pref-migrator/public/idl/guid_list.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-{C29DB6A1-D195-11d2-BCF1-00805F0E1353}
-
-{C29DB6A2-D195-11d2-BCF1-00805F0E1353}
-
-{C29DB6A3-D195-11d2-BCF1-00805F0E1353}
-
-{C29DB6A4-D195-11d2-BCF1-00805F0E1353}
-
-{C29DB6A5-D195-11d2-BCF1-00805F0E1353}
-
-{C29DB6A6-D195-11d2-BCF1-00805F0E1353}
-
-{C29DB6A7-D195-11d2-BCF1-00805F0E1353}
-
-{C29DB6A8-D195-11d2-BCF1-00805F0E1353}
-
-{C29DB6A9-D195-11d2-BCF1-00805F0E1353}
-
deleted file mode 100644
--- a/profile/pref-migrator/public/idl/prefm.idl
+++ /dev/null
@@ -1,71 +0,0 @@
-interface Prefm
-
-{
-
-/* IID: { 0xc29db6a1, 0xd195, 0x11d2,  \
-
-  {0xbc, 0xf1, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}}
-
-
-
-	/* error codes */
-
-	const int PMERR_NO_4X_ON_SYSTEM           = -200;
-
-	const int PMERR_GESTALT_UNKNOWN_ERR       = -5550;         
-
-	const int PMERR_GESTALT_INVALID_ARGUMENT  = -5551;
-
-
-
-	const int PM_SUCCESS					            = 0;
-
-
-
-	/* message IDs*/
-
-	const int PM_ALEADY_UPDATED  = 0;
-
-
-
-  /* 4.x and 5.x file names */
-
-  const char* PM_USER_PREFS_FILE_4          = "prefs.js";
-
-  const char* PM_USER_PREFS_FILE_5          = "prefs5.js";
-
-  const char* PM_COMMUNICATOR_PREFS_FILE_4  = "netscape.cfg";
-
-  const char* PM_COMMUNICATOR_PREFS_FILE_5  = "netscape5.cfg";
-
-  const char* PM_REGFILE_4                  = "nsreg.dat";
-
-  const char* PM_REGFILE_5                  = "nsreg5.dat";
-
-	
-
-	readonly attribute wstring com4xPath;
-
-  readonly attribute wstring com5xPath;
-
-	readonly attribute wstring userProfilePath;
-
-  readonly attribute wstring systemPath;
-
-
-
-	void Prefm();
-
-
-
-	long SetPrefFilePaths(in wstring systemType, 
-
-	                      in wstring com5xPath,
-
-	                      in wstring userProfilePath);
-
-
-
-
-
-};
\ No newline at end of file
deleted file mode 100644
--- a/profile/pref-migrator/public/nsIPrefMigration.idl
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * 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 ***** */
-
-#include "nsISupports.idl"
-
-%{C++
-
-#define NS_PROFILEMIGRATION_CONTRACTID "@mozilla.org/profile/migration;1"
-#define NS_PREFCONVERTER_CONTRACTID "@mozilla.org/migration/pref-converter;1"
-#define NS_ERROR_NOT_ENOUGH_SPACE_TO_MIGRATE NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_MAILNEWS, 1) 
-
-/* these are hard coded, in ascii, as they will be used for directory folder names on disk.  NEW_LOCAL_MAIL_DIR_NAME is also used as the host name for the local folders account */
-#define NEW_MAIL_DIR_NAME "Mail"
-#define NEW_NEWS_DIR_NAME "News"
-#define NEW_IMAPMAIL_DIR_NAME "ImapMail"
-#define NEW_LOCAL_MAIL_DIR_NAME "Local Folders"
-
-#if defined(XP_UNIX) && !defined(XP_MACOSX)
-#define PREF_FILE_NAME_IN_4x "preferences.js"
-#elif defined(XP_MAC) || defined(XP_MACOSX)
-#define PREF_FILE_NAME_IN_4x "Netscape Preferences"
-#elif defined(XP_WIN) || defined(XP_OS2)
-#define PREF_FILE_NAME_IN_4x "prefs.js"
-#else
-/* this will cause a failure at run time, as it should, since we don't know
-   how to migrate platforms other than Mac, Windows and UNIX */
-#define PREF_FILE_NAME_IN_4x ""
-#endif /* XP_UNIX */
-
-%}
-
-[scriptable, uuid(85c86e4c-6a6c-11d3-9a55-004005263078)]
-interface nsIPrefMigration: nsISupports
-{
-  void AddProfilePaths(in string oldProfilePathStr, in string newProfilePathStr);
-  void ProcessPrefs(in boolean showProgressAsModalWindow);
-  void ProcessPrefsFromJS();
-  /* will raise an exception from JS if there was an error */
-  void GetError();	
-
-  /**
-   * this should be in a separate interface
-   **/
-
-  void WindowCloseCallback();  
-  void ShowSpaceDialog(out PRInt32 choice);  
-};
-
-[scriptable, uuid(88fabfa4-1dd2-11b2-94a1-902f0abd94b1)]
-interface nsIPrefConverter: nsISupports
-{
-    void ConvertPrefsToUTF8();
-};
deleted file mode 100644
--- a/profile/pref-migrator/public/nsIPrefMigrationProgress.idl
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * 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 ***** */
-
-#include "nsISupports.idl"
-
-[uuid(7da18222-6a6b-11d3-8316-004005263078)]
-interface nsIPrefMigrationProgress : nsISupports
-{
-        void CreateProfileProgressDialog();
-        void MigrationStarted([const] in string UIPackageName);
-        void IncrementProgressBar();
-};
-
deleted file mode 100644
--- a/profile/pref-migrator/resources/Makefile.in
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either of the GNU General Public License Version 2 or later (the "GPL"),
-# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# 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 *****
-
-DEPTH		= ../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-# Placeholder for jar.mn
-
-include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/profile/pref-migrator/resources/content/profileMigrationProgress.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Communicator client code, released
- * March 31, 1998.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   dbragg@netscape.com
- *   sspitzer@netscape.com
- *   disttsc@bart.nl
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * 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 ***** */
-
-function onLoad(oldProfilePath, newProfilePath) {
-  dump("start of pref migration\n");
-  window.focus();
-  var prefmigrator = Components.classes['@mozilla.org/profile/migration;1'].createInstance(Components.interfaces.nsIPrefMigration);
-  if (prefmigrator) {
-    try {
-      prefmigrator.ProcessPrefsFromJS();
-    }
-    catch (ex) {
-      dump("failed to migrate: ex="+ ex + "\n");
-    }
-  }
-}
deleted file mode 100644
--- a/profile/pref-migrator/resources/content/profileMigrationProgress.xul
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0"?> 
-
-<?xml-stylesheet href="chrome://communicator/skin/profile/profile.css" type="text/css"?>
-
-<!DOCTYPE window SYSTEM "chrome://communicator/locale/profile/profileMigrationProgress.dtd" >
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 
-	onload="onLoad()"
-	title="&window.title;"
-	class="dialog"> 
-
-  <script type="application/x-javascript" src="chrome://communicator/content/profile/profileMigrationProgress.js"/> 
-
-  <keyset id="keyset"/>
-
-  <hbox>
-  	<hbox align="center">
-      		<image class="message-icon"/>
-	</hbox>
-    	<vbox flex="100%">
-                <label id="info.header" value="&dialogTitle.label;" />
-		<label id="info1" flex="100%" value="&currentlyProcessing.text;" />
-                <label id="info2" flex="100%" value="&downloadBeforeUpdate.text;" />
-		<hbox id="pm-box">
-			<progressmeter id="dialog.progress" mode="undetermined" flex="100%"/>
-		</hbox>
-   	</vbox>
-   </hbox>
-
-</window>
deleted file mode 100644
--- a/profile/pref-migrator/resources/jar.mn
+++ /dev/null
@@ -1,6 +0,0 @@
-comm.jar:
-	content/communicator/profile/profileMigrationProgress.js	(content/profileMigrationProgress.js)
-	content/communicator/profile/profileMigrationProgress.xul	(content/profileMigrationProgress.xul)
-
-en-US.jar:
-	locale/en-US/communicator/profile/profileMigrationProgress.dtd	(locale/en-US/profileMigrationProgress.dtd)
deleted file mode 100644
--- a/profile/pref-migrator/resources/locale/en-US/profileMigrationProgress.dtd
+++ /dev/null
@@ -1,6 +0,0 @@
-<!ENTITY dialogCancel.label "Cancel"> 
-<!-- LOCALIZATION NOTE (window.title) : 'Migrating' refers to converting settings to Mozilla format. -->
-<!ENTITY window.title "Converting..."> 
-<!ENTITY dialogTitle.label "Converting user profile">
-<!ENTITY currentlyProcessing.text "This may take a little while.">
-<!ENTITY downloadBeforeUpdate.text "">
--- a/profile/public/Makefile.in
+++ b/profile/public/Makefile.in
@@ -45,16 +45,13 @@ include $(DEPTH)/config/autoconf.mk
 MODULE		= profile
 
 SDK_XPIDLSRCS	= \
 		nsIProfile.idl \
 		nsIProfileChangeStatus.idl \
 		$(NULL)
 
 XPIDLSRCS	= \
-		nsIProfileInternal.idl \
-		nsIProfileStartupListener.idl \
-	        nsISessionRoaming.idl \
 	        nsIProfileUnlocker.idl \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
deleted file mode 100755
--- a/profile/public/nsIProfileInternal.idl
+++ /dev/null
@@ -1,154 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * 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 ***** */
-
-#include "nsIProfile.idl"
-
-interface nsICmdLineService;
-interface nsIFile;
-interface nsILocalFile;
-interface nsISupportsArray;
-
-%{C++
-#define NS_ERROR_PROFILE_REQUIRES_INTERACTION NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_PROFILE, 1)
-%}
-
-[scriptable, uuid(2f977d42-5485-11d4-87e2-0010a4e75ef2)]
-interface nsIProfileInternal : nsIProfile {
-    
-    /**
-     * Starts up the profile manager
-     *
-     * @param cmdLine       Arguments passed from command line - can be null
-     * @param canInteract   Whether dialogs can be shown during startup
-     *                      If false and dialogs would need to be shown, returns NS_ERROR_PROFILE_REQUIRES_INTERRACTION
-     */
-    [noscript] void startupWithArgs(in nsICmdLineService cmdLine, in boolean canInteract);
- 
-    /**
-     * Returns TRUE if in the midst of startupWithArgs
-     */
-    [noscript] readonly attribute boolean isStartingUp;
- 
-    long get4xProfileCount();
-
-   /**
-    * The following values are used with getProfileListX
-    *
-    * LIST_ONLY_NEW     - the list will contain only migrated profiles
-    * LIST_ONLY_OLD     - the list will contain only un-migrated profiles
-    * LIST_ALL          - the list will contain all profiles
-    * LIST_FOR_IMPORT   - the list is generated from 4.x registry and contains
-    *                     all the 4.x profiles
-    *                     do not use this except from the import module
-    * 
-    */
-    
-    const unsigned long LIST_ONLY_NEW  = 1;
-    const unsigned long LIST_ONLY_OLD  = 2;
-    const unsigned long LIST_ALL       = 3;
-    const unsigned long LIST_FOR_IMPORT= 4;
-    
-    void getProfileListX(in unsigned long which, out unsigned long length, [retval, array, size_is(length)] out wstring profileNames);
-   
-    void migrateProfileInfo();
-    void migrateAllProfiles();
-    void migrateProfile(in wstring profileName);
-    void remigrateProfile(in wstring profileName);
-    void forgetCurrentProfile();
-    void createDefaultProfile();
-
-    /**
-     * Returns the actual profile directory
-     */
-    nsIFile getProfileDir(in wstring profileName);
-    
-    /**
-     * Returns the path to a profile which can be shown to the user.
-     * If the actual profile directory is salted, returns the unsalted parent.
-     * This is the directory which will be deleted by deleteProfile(name, true).
-     */
-    wstring getProfilePath(in wstring profileName);
-    
-    /**
-     * Returns a profile directory of the importType. The path will point to 
-     * the 4.x profile directory. Should be used only from the import module.
-     */
-    nsILocalFile getOriginalProfileDir(in wstring profileName);
-
-    /**
-     * Returns the date on which a profile was last used.
-     * value is in milliseconds since midnight Jan 1, 1970 GMT (same as nsIFile)
-     */
-    PRInt64 getProfileLastModTime(in wstring profileName);
-    
-    attribute boolean automigrate;
-    readonly attribute nsIFile defaultProfileParentDir;
-    readonly attribute wstring firstProfile;
-    
-    /**
-     * Affects startup behavior when there are multiple profiles.
-     *  If FALSE, the profile selection dialog will be shown.
-     *  If TRUE, the last used profile will be chosen automatically.
-     */ 
-    attribute boolean startWithLastUsedProfile;
-
-    [noscript] void updateRegistry(in nsIFile regName);
-    [noscript] void getRegStrings(in wstring profileName,
-                       out wstring regString,
-                       out wstring regName,
-                       out wstring regEmail,
-                       out wstring regOption);
-    [noscript] void setRegStrings(in wstring profileName, 
-                       in wstring regString,
-                       in wstring regName,
-                       in wstring regEmail,
-                       in wstring regOption);
-    [noscript] string isRegStringSet(in wstring profileName);
-    
-    void createNewProfileWithLocales(in wstring profileName,
-                          in wstring nativeProfileDir,
-                          in wstring UILocale,
-                          in wstring contentLocale,
-                          in boolean useExistingDir);
-   /**
-    * The remaining methods are deprecated. DO NOT USE THEM.
-    */
-    
-    boolean isCurrentProfileAvailable();
-    [noscript] void getCurrentProfileDir(out nsIFile profileDir);
-
-};
deleted file mode 100644
--- a/profile/public/nsIProfileStartupListener.idl
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * 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 ***** */
-
-#include "nsISupports.idl"
-
-%{C++
-
-#define NS_PROFILE_STARTUP_LISTENER_CID                \
-  { /* {6962ca90-0b8b-11d4-9875-00c04fa0d28b} */       \
-    0x6962ca90,                                        \
-    0x0b8b,                                            \
-    0x11d4,                                            \
-    { 0x98, 0x75, 0x00, 0xc0, 0x4f, 0xa0, 0xd2, 0x8b } \
-  }
-
-#define NS_PROFILE_STARTUP_LISTENER_CONTRACTID	\
-	"@mozilla.org/profile/startuplistener;1"
-%}
-
-[scriptable, uuid(6962ca8f-0b8b-11d4-9875-00c04fa0d28b)]
-interface nsIProfileStartupListener : nsISupports {
-
-    void onProfileStartup(in wstring profileName);
-
-};
deleted file mode 100644
--- a/profile/public/nsISessionRoaming.idl
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Roaming code.
- *
- * The Initial Developer of the Original Code is 
- * Ben Bucksch <http://www.bucksch.org> of
- * Beonex <http://www.beonex.com>
- * Portions created by the Initial Developer are Copyright (C) 2002
- * the Initial Developer. All Rights Reserved.
- * Or maybe not. I believe that interfaces should be free ;-).
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * 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 ***** */
-
-#include "nsISupports.idl"
-#include "nsIFile.idl"
-
-/**
- * nsISessionRoaming
- *
- * Implementation should be a service.
- *
- * see extensions/sraoming/README.txt
- * 
- * @status EXPERIMENTAL
- * @version 1.0
- */
-
-[scriptable, uuid(ab62465c-494c-446e-b671-930bb98a7bc4)]
-interface nsISessionRoaming : nsISupports {
-    void BeginSession(); 
-    void EndSession(); 
-    boolean isRoaming();                  // should be here?
-};
deleted file mode 100644
--- a/profile/resources/Makefile.in
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either of the GNU General Public License Version 2 or later (the "GPL"),
-# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# 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 *****
-
-DEPTH		= ../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-# Placeholder for jar.mn
-
-include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/profile/resources/content/createProfileWizard.js
+++ /dev/null
@@ -1,240 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Communicator client code, released
- * March 31, 1998.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998-1999
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Ben Goodger (30/09/99)
- *   Brant Gurganus (23/03/03)
- *   Stefan Borggraefe (17/10/03)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * 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 ***** */
-
-var gProfile = Components.classes["@mozilla.org/profile/manager;1"].getService(Components.interfaces.nsIProfileInternal);
-var gProfileManagerBundle;
-
-// The directory where the profile will be created.
-var gProfileRoot;
-
-// Text node to display the location and name of the profile to create.
-var gProfileDisplay;
-
-// Called once when the wizard is opened.
-function initWizard()
-{ 
-  gProfileManagerBundle = document.getElementById("bundle_profileManager");
-    
-  // Initialize the profile location display.
-  gProfileDisplay = document.getElementById("profileDisplay").firstChild;
-  setDisplayToDefaultFolder();
-}
-
-// Called every time the second wizard page is displayed.
-function initSecondWizardPage() 
-{
-  var profileName = document.getElementById("profileName");
-  profileName.select();
-  profileName.focus();
-
-  // Initialize profile name validation.
-  checkCurrentInput(profileName.value);
-}
-
-function setDisplayToDefaultFolder()
-{
-  setDisplayToFolder(gProfile.defaultProfileParentDir);
-  document.getElementById("useDefault").disabled = true;
-}
-
-function setDisplayToFolder(profileRoot)
-{
-  var profileName = document.getElementById("profileName");
-  profileName.focus();
-  gProfileRoot = profileRoot;
-}
-
-function updateProfileDisplay()
-{
-  var currentProfileName = document.getElementById("profileName").value;
-  var profilePathAndName = gProfileRoot.clone();
-
-  profilePathAndName.append(currentProfileName);
-  gProfileDisplay.data = profilePathAndName.path;
-}
-
-// Shows the Language/Region Selection dialog and updates the data-Attributes to 
-// the selected values.
-function showLangDialog()
-{
-  var languageCode = document.getElementById("profileLanguage").getAttribute("data");
-  var regionCode = document.getElementById("profileRegion").getAttribute("data");
-  window.openDialog("chrome://communicator/content/profile/selectLang.xul",
-                    "", "centerscreen,modal,titlebar",
-                    languageCode, regionCode);
-}
-
-// Invoke a folder selection dialog for choosing the directory of profile storage.
-function chooseProfileFolder()
-{
-  var newProfileRoot;
-  
-  try {
-    var dirChooser = Components.classes["@mozilla.org/filepicker;1"].createInstance(Components.interfaces.nsIFilePicker);
-    dirChooser.init(window, gProfileManagerBundle.getString("chooseFolder"), Components.interfaces.nsIFilePicker.modeGetFolder);
-    dirChooser.appendFilters(Components.interfaces.nsIFilePicker.filterAll);
-    if (dirChooser.show() == dirChooser.returnCancel)
-      return;
-    newProfileRoot = dirChooser.file;
-  }
-  catch(e) {
-    // If something fails, change nothing.
-    return;
-  }
-
-  // Disable the "Default Folder..." button when the default profile folder
-  // was selected manually in the File Picker.
-  document.getElementById("useDefault").disabled = (newProfileRoot.equals(gProfile.defaultProfileParentDir));
-
-  setDisplayToFolder(newProfileRoot);
-  updateProfileDisplay();
-}
-
-// Checks the current user input for validity and triggers an error message accordingly.
-function checkCurrentInput(currentInput)
-{
-  var finishButton = document.documentElement.getButton("finish");
-  var finishText = document.getElementById("finishText");
-  var canAdvance;
-
-  var errorMessage = checkProfileName(currentInput);
-  if (!errorMessage) {
-    finishText.className = "";
-    finishText.firstChild.data = gProfileManagerBundle.getString("profileFinishText");
-    canAdvance = true;
-  }
-  else {
-    finishText.className = "error";
-    finishText.firstChild.data = errorMessage;
-    canAdvance = false;
-  }
-
-  document.documentElement.canAdvance = canAdvance;
-  finishButton.disabled = !canAdvance;
-
-  updateProfileDisplay();
-}
-
-// Checks whether the given string is a valid profile name.
-// Returns an error message describing the error in the name or "" when it's valid.
-function checkProfileName(profileNameToCheck)
-{
-  // Check for emtpy profile name.
-  if (!/\S/.test(profileNameToCheck))
-    return gProfileManagerBundle.getString("profileNameEmpty");
-
-  // Check whether all characters in the profile name are allowed.
-  if (/([\\*:?<>|\/\"])/.test(profileNameToCheck))
-    return gProfileManagerBundle.getFormattedString("invalidChar", [RegExp.$1]);
-
-  // Check whether a profile with the same name already exists.
-  if (gProfile.profileExists(profileNameToCheck))
-    return gProfileManagerBundle.getString("profileExists");
-
-  // profileNameToCheck is valid.
-  return "";
-}
-
-// Called when the first wizard page is shown.
-function enableNextButton()
-{
-  document.documentElement.canAdvance = true;
-}
-
-function onCancel()
-{
-  // window.opener is false if the Create Profile Wizard was opened from the command line.
-  if (!window.opener)
-    return true;
-
-  try {
-    gProfile.forgetCurrentProfile();
-  }
-  catch (ex) {
-  }
-
-  return true;
-}
-
-function onFinish() 
-{
-  var profileName = document.getElementById("profileName").value;
-  var languageCode = document.getElementById("profileLanguage").getAttribute("data");
-  var regionCode = document.getElementById("profileRegion").getAttribute("data");
-
-  var proceed = processCreateProfileData(profileName, gProfileRoot, languageCode, regionCode);
-  // Error on profile creation. Don't leave the wizard so the user can correct his input.
-  if (!proceed)
-    return false;
-
-  // window.opener is false if the Create Profile Wizard was opened from the command line.
-  if (window.opener)
-    // Add new profile to the list in the Profile Manager.
-    window.opener.CreateProfile(profileName, gProfileRoot);
-  else {
-    // Use the newly created Profile.
-    gProfile.currentProfile = profileName;
-    var dialogParams = window.arguments[0].QueryInterface(Components.interfaces.nsIDialogParamBlock);
-    dialogParams.SetInt(0, 1); //set the newly created profile as the default
-  }
-
-  // Exit the wizard.
-  return true;
-}
-
-// Create profile named profileName in profileRoot.
-function processCreateProfileData(profileName, profileRoot, languageCode, regionCode)
-{
-  try {
-    var profileLocation = profileRoot.clone();
-    profileLocation.append(profileName);
-    gProfile.createNewProfileWithLocales(profileName, profileRoot.path, languageCode, regionCode, profileLocation.exists());
-
-    return true;
-  }
-  catch (e) {
-    var profileCreationFailed = gProfileManagerBundle.getString("profileCreationFailed");
-    var profileCreationFailedTitle = gProfileManagerBundle.getString("profileCreationFailedTitle");
-    var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
-    promptService.alert(window, profileCreationFailedTitle, profileCreationFailed);
-
-    return false;
-  }
-}
deleted file mode 100644
--- a/profile/resources/content/createProfileWizard.xul
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://communicator/skin/profile/profile.css" type="text/css"?>
-
-<!DOCTYPE wizard [
-<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
-%brandDTD;
-<!ENTITY % profileDTD SYSTEM "chrome://communicator/locale/profile/createProfileWizard.dtd">
-%profileDTD;
-]>
-
-<wizard id="createProfileWizard"
-        title="&newprofile.title;"
-        xmlns:html="http://www.w3.org/1999/xhtml"
-        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        onwizardcancel="return onCancel();"
-        onwizardfinish="return onFinish();"
-        onload="initWizard();"
-        style="&window.size;">
-  
-  <stringbundle id="bundle_profileManager"
-                src="chrome://communicator/locale/profile/profileManager.properties"/>
-
-  <script type="application/x-javascript" src="chrome://communicator/content/profile/createProfileWizard.js"/>
-
-  <wizardpage id="explanation" onpageshow="enableNextButton();">
-    <description>&profileCreationExplanation_1.text;</description>
-    <description>&profileCreationExplanation_2.text;</description>
-    <description>&profileCreationExplanation_3.text;</description>
-    <spacer flex="1"/>
-    <description>&profileCreationExplanation_4.text;</description>
-  </wizardpage>
-
-  <wizardpage id="createProfile" onpageshow="initSecondWizardPage();">
-    <description>&profileCreationIntro.text;</description> 
-
-    <label accesskey="&profilePrompt.accesskey;" control="ProfileName">&profilePrompt.label;</label> 
-    <textbox id="profileName" value="&profileDefaultName;"
-             oninput="checkCurrentInput(this.value);"/>
-    
-    <separator/>
-
-    <description>&profileDirExplanation.text;</description>
-
-    <vbox class="indent" flex="1" style="overflow: auto;">
-      <description id="profileDisplay">*</description>
-    </vbox>
-
-    <hbox>
-      <button label="&button.choosefolder.label;" oncommand="chooseProfileFolder();" 
-              accesskey="&button.choosefolder.accesskey;"/>
-
-      <button id="useDefault" label="&button.usedefault.label;"
-              oncommand="setDisplayToDefaultFolder(); updateProfileDisplay();"
-              accesskey="&button.usedefault.accesskey;" disabled="true"/>
-
-      <button label="&button.langSelection.label;" oncommand="showLangDialog();"
-              accesskey="&button.langSelection.accesskey;"/>
-    </hbox>
-
-    <separator/>
-
-    <description id="finishText">*</description>
-
-    <data id="profileLanguage"/>
-    <data id="profileRegion"/>
-  </wizardpage>
-
-</wizard>
deleted file mode 100644
--- a/profile/resources/content/migrateAllProfile.xul
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://communicator/skin/profile/profile.css" type="text/css"?>
-<?xml-stylesheet href="chrome://communicator/skin/profile/profileManager.css" type="text/css"?>
-
-<!DOCTYPE window SYSTEM "chrome://communicator/locale/profile/profileManagerMigrateAll.dtd" >
-<window
-  xmlns:html="http://www.w3.org/1999/xhtml"
-  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-  title="&title;" width="300" height="120">
-
-<html:div flex="100%">
-
-<html:center>
-<html:div>&intro;</html:div>
-<html:br />
-<button label="&ok.label;" class="push" onclick="opener.migrateAllProfiles();window.close();" />
-<button label="&cancel.label;" class="push" onclick="window.close();" />
-</html:center>
-
-</html:div>
-</window>
deleted file mode 100644
--- a/profile/resources/content/profileManager.js
+++ /dev/null
@@ -1,350 +0,0 @@
-/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Communicator client code, released
- * March 31, 1998.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998-1999
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Ben Goodger <ben@netscape.com>
- *   Brant Gurganus <brantgurganus2001@cherokeescouting.org>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * 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 ***** */
-
-//NOTE: This script expects gBrandBundle and gProfileManagerBundle to be
-//      instantiated elsewhere (currently from StartUp in profileSelection.js)
-
-var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
-var profileManagerMode = "selection";
-var set = null;
-
-// invoke the createProfile Wizard
-function CreateProfileWizard()
-{
-  window.openDialog('chrome://communicator/content/profile/createProfileWizard.xul',
-                    '', 'centerscreen,chrome,modal,titlebar');
-}
-
-// update the display to show the additional profile
-function CreateProfile( aProfName, aProfDir )
-{
-  AddItem(aProfName, "yes");
-  var profileList = document.getElementById( "profiles" );
-  profileList.view.selection.select(profileList.view.rowCount - 1);
-  profileList.treeBoxObject.ensureRowIsVisible(profileList.currentIndex);
-}
-
-// rename the selected profile
-function RenameProfile()
-{
-  var lString, oldName, newName;
-  var renameButton = document.getElementById("renbutton");
-  if (renameButton.getAttribute("disabled") == "true" )
-    return false;
-  var profileList = document.getElementById( "profiles" );
-  var selected = profileList.view.getItemAtIndex(profileList.currentIndex);
-  var profilename = selected.getAttribute("profile_name");
-  var errorMessage = null;
-  if( selected.getAttribute("rowMigrate") == "no" ) {
-    // migrate if the user wants to
-    lString = gProfileManagerBundle.getString("migratebeforerename");
-    lString = lString.replace(/\s*<html:br\/>/g,"\n");
-    lString = lString.replace(/%brandShortName%/, gBrandBundle.getString("brandShortName"));
-    var title = gProfileManagerBundle.getString("migratetitle");
-    if (promptService.confirm(window, title, lString)) {
-      var profileDir = profile.getProfileDir(profilename);
-      if (profileDir) {
-        profileDir = profileDir.QueryInterface( Components.interfaces.nsIFile );
-        if (profileDir) {
-          if (!profileDir.exists()) {
-            errorMessage = gProfileManagerBundle.getString("sourceProfileDirMissing");
-            var profileDirMissingTitle = gProfileManagerBundle.getString("sourceProfileDirMissingTitle");
-            promptService.alert(window, profileDirMissingTitle, errorMessage);
-            return false;
-          }
-        }
-      }      
-      profile.migrateProfile( profilename );
-    }
-    else
-      return false;
-  }
-  else {
-    oldName = selected.getAttribute("profile_name");
-    newName = {value:oldName};
-    var dialogTitle = gProfileManagerBundle.getString("renameprofiletitle");
-    var msg = gProfileManagerBundle.getString("renameProfilePrompt");
-    msg = msg.replace(/%oldProfileName%/gi, oldName);
-    while (1) {
-      var rv = promptService.prompt(window, dialogTitle, msg, newName, null, {value:0});
-      if (rv) {
-        newName = newName.value;
-
-        // User hasn't changed the profile name. Treat as if cancel was pressed.
-        if (newName == oldName)
-          return false;
-
-        errorMessage = checkProfileName(newName);
-        if (errorMessage) {
-          var profileNameInvalidTitle = gProfileManagerBundle.getString("profileNameInvalidTitle");
-          promptService.alert(window, profileNameInvalidTitle, errorMessage);
-          return false;
-        }
-        
-        var migrate = selected.getAttribute("rowMigrate");
-        try {
-          profile.renameProfile(oldName, newName);
-          selected.firstChild.firstChild.setAttribute( "label", newName );
-          selected.setAttribute( "profile_name", newName );
-        }
-        catch(e) {
-          lString = gProfileManagerBundle.getString("profileExists");
-          var profileExistsTitle = gProfileManagerBundle.getString("profileExistsTitle");
-          promptService.alert(window, profileExistsTitle, lString);
-          continue;
-        }
-      }
-      break;
-    }
-  }
-  // set the button state
-  DoEnabling(); 
-  return true; 
-}
-
-
-function ConfirmDelete()
-{
-  var deleteButton = document.getElementById("delbutton");
-  if( deleteButton.getAttribute("disabled") == "true" )
-    return;
-  var profileList = document.getElementById( "profiles" );
-
-  var selected = profileList.view.getItemAtIndex(profileList.currentIndex);
-  var name = selected.getAttribute("profile_name");
-  
-  var dialogTitle = gProfileManagerBundle.getString("deletetitle");
-  var dialogText;
-  
-  if( selected.getAttribute("rowMigrate") == "no" ) {
-    var brandName = gBrandBundle.getString("brandShortName");
-    dialogText = gProfileManagerBundle.getFormattedString("delete4xprofile", [brandName]);
-    dialogText = dialogText.replace(/\s*<html:br\/>/g,"\n");
-    
-    if (promptService.confirm(window, dialogTitle, dialogText)) {
-      profile.deleteProfile( name, false );
-      profileList.removeChild( selected );
-    }
-    return;
-  }
-  else {
-    var pathExists = true;
-    try {
-      var path = profile.getProfilePath(name);
-    }
-    catch (ex) {
-      pathExists = false;
-    }
-    if (pathExists) {
-      dialogText = gProfileManagerBundle.getFormattedString("deleteprofile", [path]);
-      dialogText = dialogText.replace(/\s*<html:br\/>/g,"\n");
-      var buttonPressed = promptService.confirmEx(window, dialogTitle, dialogText,
-                              (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0) +
-                              (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1) +
-                              (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_2),
-                              gProfileManagerBundle.getString("dontDeleteFiles"),
-                              null,
-                              gProfileManagerBundle.getString("deleteFiles"),
-                              null, {value:0});
-      if (buttonPressed != 1)
-          DeleteProfile(buttonPressed == 2);
-    }
-    else
-      DeleteProfile(false);
-  }
-}
-
-// Delete the profile, with the delete flag set as per instruction above.
-function DeleteProfile(deleteFiles)
-{
-  var profileList = document.getElementById("profiles");
-  if (profileList.view.selection.count) {
-    var selected = profileList.view.getItemAtIndex(profileList.currentIndex);
-    var name = selected.getAttribute("profile_name");
-    var previous = profileList.currentIndex - 1;
-
-    try {
-      profile.deleteProfile(name, deleteFiles);
-      profileList.lastChild.removeChild(selected);
-
-      if (previous) {
-        profileList.view.selection.select(previous);
-        profileList.treeBoxObject.ensureRowIsVisible(previous);
-      }
-
-      // set the button state
-      DoEnabling();
-    }
-    catch (ex) {
-      dump("Exception during profile deletion.\n");
-    }
-  }
-}
-
-function ConfirmMigrateAll()
-{
-  var string = gProfileManagerBundle.getString("migrateallprofiles");
-  var title = gProfileManagerBundle.getString("migrateallprofilestitle");
-  if (promptService.confirm(window, title, string))
-    return true;
-  else 
-    return false;
-}
-
-function SwitchProfileManagerMode()
-{
-  var prattleIndex  = null;
-  var captionLine   = null;
-  var buttonDisplay = null;
-  var selItems      = [];
-  
-  if( profileManagerMode == "selection" )
-  {
-    prattleIndex = 1;                                       // need to switch to manager's index
-    
-    try {
-      captionLine = gProfileManagerBundle.getString("pm_title"); // get manager's caption
-    } catch(e) {
-      captionLine = "Manage Profiles *";
-    }
-    
-    var profileList = document.getElementById("profiles");
-    profileList.focus();
-
-    // hide the manage profiles button...
-    document.documentElement.getButton("extra2").hidden = true;
-    profileManagerMode = "manager";                         // swap the mode
-  } 
-  else {
-    prattleIndex = 0;
-    try {
-      captionLine = gProfileManagerBundle.getString("ps_title");
-    } catch(e) {
-      captionLine = "Select Profile *";
-    }
-    profileManagerMode = "selection";
-  }
-
-  // swap deck  
-  var deck = document.getElementById( "prattle" );
-  deck.setAttribute( "selectedIndex", prattleIndex )
-    
-  // swap caption
-  ChangeCaption( captionLine );
-  
-  set = !set;
-}
-
-// change the title of the profile manager/selection window.
-function ChangeCaption( aCaption )
-{
-  var caption = document.getElementById( "header" );
-  caption.setAttribute( "description", aCaption );
-  document.title = aCaption;
-}
-
-// do button enabling based on tree selection
-function DoEnabling()
-{
-  var renbutton = document.getElementById( "renbutton" );
-  var delbutton = document.getElementById( "delbutton" );
-  var start     = document.documentElement.getButton( "accept" );
-  
-  var profileList = document.getElementById( "profiles" );
-  if (profileList.view.selection.count == 0)
-  {
-    renbutton.setAttribute( "disabled", "true" );
-    delbutton.setAttribute( "disabled", "true" );
-    start.setAttribute( "disabled", "true" );
-  }
-  else {
-    if( renbutton.getAttribute( "disabled" ) == "true" )
-      renbutton.removeAttribute( "disabled", "true" );
-    if( start.getAttribute( "disabled" ) == "true" )
-      start.removeAttribute( "disabled", "true" );
-    
-    var canDelete = true;
-    if (!gStartupMode) {  
-      var selected = profileList.view.getItemAtIndex(profileList.currentIndex);
-      var profileName = selected.getAttribute("profile_name");
-      var currentProfile = profile.currentProfile;
-      if (currentProfile && (profileName == currentProfile))
-        canDelete = false;      
-    }
-    if (canDelete) {
-      if ( delbutton.getAttribute( "disabled" ) == "true" )
-        delbutton.removeAttribute( "disabled" );
-    }
-    else
-      delbutton.setAttribute( "disabled", "true" );
-      
-  }
-}
-
-// handle key event on tree
-function HandleKeyEvent( aEvent )
-{
-  switch( aEvent.keyCode ) 
-  {
-  case 46:
-    if( profileManagerMode != "manager" )
-      return;
-    ConfirmDelete();
-    break;
-  case KeyEvent.DOM_VK_F2:
-    if( profileManagerMode != "manager" )
-      return;
-    RenameProfile();
-    break;
-  }
-}
-
-function HandleClickEvent( aEvent )
-{
-  if (aEvent.button == 0 && aEvent.target.parentNode.view.selection.count) {
-    if (!onStart())
-      return false;
-    window.close();
-    return true;
-  }
-  return false;
-}
-
deleted file mode 100644
--- a/profile/resources/content/profileSelection.js
+++ /dev/null
@@ -1,289 +0,0 @@
-/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Communicator client code, released
- * March 31, 1998.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998-1999
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Ben Goodger (03/01/00)
- *   Seth Spitzer (28/10/99)
- *   Dan Veditz <dveditz@netscape.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * 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 ***** */
-
-var gDialogParams;
-var gStartupMode; // TRUE if we're being shown at app startup, FALSE if from menu.
-var gProfileManagerBundle;
-var gBrandBundle;
-var profile     = Components.classes["@mozilla.org/profile/manager;1"].getService();
-if (profile)
-  profile       = profile.QueryInterface(Components.interfaces.nsIProfileInternal);
-
-var Registry;
-
-function StartUp()
-{
-  gDialogParams = window.arguments[0].
-                    QueryInterface(Components.interfaces.nsIDialogParamBlock);
-  gStartupMode = (gDialogParams.GetString(0) == "startup");
-  
-  gProfileManagerBundle = document.getElementById("bundle_profileManager");
-  gBrandBundle = document.getElementById("bundle_brand");
-
-  if (gStartupMode) {
-    document.documentElement.setAttribute("buttonlabelcancel",
-      document.documentElement.getAttribute("buttonlabelexit"));
-    document.documentElement.setAttribute("buttonlabelaccept",
-      document.documentElement.getAttribute("buttonlabelstart"));
-  }
-
-  if(window.location && window.location.search && window.location.search == "?manage=true" )
-    SwitchProfileManagerMode();
-  else {  
-    // Set up the intro text, depending on our context
-    var introTextItem = document.getElementById("intro");
-    var insertText = document.documentElement.getAttribute("buttonlabelaccept");
-    var introText = gProfileManagerBundle.getFormattedString(
-                      gStartupMode ? "intro_start" : "intro_switch",
-                      [insertText]);
-    introTextItem.textContent = introText;
-  }
-
-  var dirServ = Components.classes['@mozilla.org/file/directory_service;1']
-                          .getService(Components.interfaces.nsIProperties);
-
-  // "AggRegF" stands for Application Registry File.
-  // Forgive the weird name directory service has adapted for
-  // application registry file....
-  var regFile = dirServ.get("AppRegF", Components.interfaces.nsIFile);
-
-  Registry = Components.classes['@mozilla.org/registry;1'].createInstance();
-  Registry = Registry.QueryInterface(Components.interfaces.nsIRegistry);
-  Registry.open(regFile);
-
-  loadElements();
-  highlightCurrentProfile();
-
-  var offlineState = document.getElementById("offlineState");
-  if (gStartupMode) {
-    // set the checkbox to reflect the current state.
-    var ioService = Components.classes["@mozilla.org/network/io-service;1"].
-                      getService(Components.interfaces.nsIIOService);
-    offlineState.checked = ioService.offline;
-  }
-  else {
-    // hide the checkbox in this context
-    offlineState.hidden = true;
-  }
-
-  var autoSelectLastProfile = document.getElementById("autoSelectLastProfile");
-  var prefs = Components.classes["@mozilla.org/preferences-service;1"]
-                    .getService(Components.interfaces.nsIPrefBranch);
-  if (prefs.getBoolPref("profile.manage_only_at_launch"))
-    autoSelectLastProfile.hidden = true;
-  else
-    autoSelectLastProfile.checked = profile.startWithLastUsedProfile;
-
-  var profileList = document.getElementById("profiles");
-  profileList.focus();
-
-  DoEnabling();
-}
-
-// select the last opened profile in the profile list
-function highlightCurrentProfile()
-{
-  try {
-    var currentProfile = profile.currentProfile;
-    if( !currentProfile )
-      return;
-    var profileList = document.getElementById( "profiles" );
-    var currentProfileItem = profileList.getElementsByAttribute("profile_name", currentProfile).item(0);
-    if( currentProfileItem ) {
-      var currentProfileIndex = profileList.view.getIndexOfItem(currentProfileItem);
-      profileList.view.selection.select( currentProfileIndex );
-      profileList.treeBoxObject.ensureRowIsVisible( currentProfileIndex );
-    }
-  }
-  catch(e) {
-    dump("*** failed to select current profile in list\n");
-  }
-}
-
-// function : <profileSelection.js>::AddItem();
-// purpose  : utility function for adding items to a tree.
-function AddItem(aName, aMigrated)
-{
-  var tree = document.getElementById("profiles");
-  var treeitem = document.createElement("treeitem");
-  var treerow = document.createElement("treerow");
-  var treecell = document.createElement("treecell");
-  treecell.setAttribute("label", aName);
-  treecell.setAttribute("properties", "rowMigrate-" + aMigrated);
-  treeitem.setAttribute("profile_name", aName);
-  treeitem.setAttribute("rowMigrate", aMigrated);
-  treerow.appendChild(treecell);
-  treeitem.appendChild(treerow);
-  tree.lastChild.appendChild(treeitem);
-}
-
-// function : <profileSelection.js>::loadElements();
-// purpose  : load profiles into tree
-function loadElements()
-{
-  try {
-    var profileRoot = Registry.getKey(Registry.Common, "Profiles");
-    var regEnum = Registry.enumerateSubtrees( profileRoot );
-
-    // the registry class is old and uses sucky nsIEnumerator instead
-    // of nsISimpleEnumerator. We'll rely on a blank profile name to
-    // throw us out of the while loop for now.
-    regEnum.first();
-    while (true)
-    {
-      var node = regEnum.currentItem();
-      node = node.QueryInterface(Components.interfaces.nsIRegistryNode);
-
-      if ( node.name == "" )
-        break;
-
-      var migrated = Registry.getString( node.key, "migrated" );
-
-      AddItem(node.name, migrated);
-
-      regEnum.next();
-    }
-  }
-  catch (e) {}
-}
-
-
-// function : <profileSelection.js>::onStart();
-// purpose  : sets the current profile to the selected profile (user choice: "Start Mozilla")
-function onStart()
-{
-  var profileList = document.getElementById("profiles");
-  var selected = profileList.view.getItemAtIndex(profileList.currentIndex);
-  var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].
-    getService(Components.interfaces.nsIPromptService);
-
-  var profilename = selected.getAttribute("profile_name");
-  if( selected.getAttribute("rowMigrate") == "no" ) {
-    var lString = gProfileManagerBundle.getString("migratebeforestart");
-    lString = lString.replace(/\s*<html:br\/>/g,"\n");
-    lString = lString.replace(/%brandShortName%/gi,
-                              gBrandBundle.getString("brandShortName"));
-    var title = gProfileManagerBundle.getString("migratetitle");
-
-    if (promptService.confirm(window, title, lString)) {
-      var profileDir = profile.getProfileDir(profilename);
-      if (profileDir) {
-        profileDir = profileDir.QueryInterface( Components.interfaces.nsIFile );
-        if (profileDir) {
-          if (!profileDir.exists()) {
-            var errorMessage = gProfileManagerBundle.getString("sourceProfileDirMissing");
-            var profileDirMissingTitle = gProfileManagerBundle.getString("sourceProfileDirMissingTitle");
-            promptService.alert(window, profileDirMissingTitle, errorMessage);
-              return false;          
-          }
-        }
-      }      
-      profile.migrateProfile( profilename );
-    }
-    else
-      return false;
-  }
-
-  // start in online or offline mode
-  if (gStartupMode) {
-    var offlineState = document.getElementById("offlineState");
-    var ioService = Components.classes["@mozilla.org/network/io-service;1"]
-                              .getService(Components.interfaces.nsIIOService2);
-    if (offlineState.checked != ioService.offline) {
-      ioService.manageOfflineStatus = false;
-      ioService.offline = offlineState.checked;
-    }
-  }
-
-  var autoSelectLastProfile = document.getElementById("autoSelectLastProfile");
-  if (!autoSelectLastProfile.hidden)
-    profile.startWithLastUsedProfile = autoSelectLastProfile.checked;
-
-  try {
-    profile.currentProfile = profilename;
-  }
-  catch (ex) {
-	  var brandName = gBrandBundle.getString("brandShortName");    
-    var message;
-    var fatalError = false;
-    switch (ex.result) {
-      case Components.results.NS_ERROR_FILE_ACCESS_DENIED:
-        message = gProfileManagerBundle.getFormattedString("profDirLocked", [brandName, profilename]);
-        message = message.replace(/\s*<html:br\/>/g,"\n");
-        break;
-      case Components.results.NS_ERROR_FILE_NOT_FOUND:
-        message = gProfileManagerBundle.getFormattedString("profDirMissing", [brandName, profilename]);
-        message = message.replace(/\s*<html:br\/>/g,"\n");
-        break;
-      case Components.results.NS_ERROR_ABORT:
-        message = gProfileManagerBundle.getFormattedString("profileSwitchFailed", [brandName, profilename, brandName, brandName]);
-        message = message.replace(/\s*<html:br\/>/g,"\n");
-        fatalError = true;
-        break;
-      default:
-        message = ex.message;
-        break;
-  }
-      promptService.alert(window, null, message);
-
-      if (fatalError)
-      {
-        var appStartup = Components.classes["@mozilla.org/seamonkey/app-startup;1"]
-                                   .getService(Components.interfaces.nsIAppStartup);
-        appStartup.quit(Components.interfaces.nsIAppStartup.eForceQuit);
-      }
-
-      return false;
-  }
-  
-  gDialogParams.SetInt(0, 1); // 1 == success
-    
-  return true;
-}
-
-// function : <profileSelection.js>::onExit();
-// purpose  : quits startup process (User Choice: "Exit")
-function onExit()
-{
-  gDialogParams.SetInt(0, 0); // 0 == cancel
-  return true;
-}
deleted file mode 100644
--- a/profile/resources/content/profileSelection.xul
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0"?> 
-<!-- -*- Mode: SGML; indent-tabs-mode: nil; -*- -->
-<!--
-
- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is
- Netscape Communications Corporation.
- Portions created by the Initial Developer are Copyright (C) 1998
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
-   Code:     Ben Goodger <ben@netscape.com>
-   UI Ideas: Matthew Thomas, Ben Gregory
-
- Alternatively, the contents of this file may be used under the terms of
- either of the GNU General Public License Version 2 or later (the "GPL"),
- or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the GPL or the LGPL. If you do not delete
- 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 ***** -->
-
-<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://communicator/skin/profile/profile.css" type="text/css"?>
-
-<!DOCTYPE dialog [
-<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
-%brandDTD;
-<!ENTITY % profileDTD SYSTEM "chrome://communicator/locale/profile/profileSelection.dtd">
-%profileDTD;
-]>
-
-<dialog
-  id="profileWindow"
-  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 
-  title="&windowtitle.label;"
-  windowtype="mozilla:profileSelection"
-  orient="vertical"
-  style="width: 42em;"
-  spacerflex="1"
-  buttons="accept,cancel,extra2"
-  buttonlabelstart="&start.label;"
-  buttonlabelexit="&exit.label;"
-  buttonlabelaccept="&select.label;"
-  buttonlabelextra2="&manage.label;"
-  buttonaccesskeyextra2="&manage.accesskey;"
-  ondialogaccept="return onStart();"
-  ondialogcancel="return onExit();"
-  ondialogextra2="SwitchProfileManagerMode();"
-  onload="StartUp();"> 
-      
-  <stringbundle id="bundle_profileManager"
-                src="chrome://communicator/locale/profile/profileManager.properties"/>
-  <stringbundle id="bundle_brand"
-                src="chrome://branding/locale/brand.properties"/>
-  
-  <script type="application/x-javascript" src="chrome://communicator/content/profile/profileSelection.js"/>
-  <script type="application/x-javascript" src="chrome://communicator/content/profile/profileManager.js"/>
-  <script type="application/x-javascript" src="chrome://communicator/content/profile/createProfileWizard.js"/>
-
-  <dialogheader class="header-large" id="header" title="&profilemanager.label;" description="&windowtitle.label;"/>
-  
-  <hbox class="wizard-box" flex="1">
-
-    <!-- instructions -->
-    <deck id="prattle">
-      <description id="intro" style="width: 17em;"/>
-      <vbox id="manager">
-        <description style="width: 17em;" class="label">&pmTextA.label;</description>
-        <separator/>
-        <hbox>
-          <vbox flex="1" id="managebuttons">
-            <button id="newbutton" label="&newButton.label;" accesskey="&newButton.accesskey;" oncommand="CreateProfileWizard();"/>
-            <button id="renbutton" label="&renameButton.label;" accesskey="&renameButton.accesskey;" oncommand="RenameProfile();"/>
-            <button id="delbutton" label="&deleteButton.label;" accesskey="&deleteButton.accesskey;" oncommand="ConfirmDelete();"/>
-          </vbox>
-          <spacer flex="2"/>
-        </hbox>
-      </vbox>
-    </deck>  
-      
-    <separator class="thin" orient="vertical"/>
-    
-    <vbox flex="1">
-      <tree id="profiles" flex="1" style="height: 0px;" seltype="single"
-            hidecolumnpicker="true"
-            onselect="DoEnabling();"
-            onkeypress="HandleKeyEvent( event );">
-        <treecols>
-          <treecol label="&availprofiles.label;" flex="1"/>
-        </treecols>
-        <treechildren ondblclick="HandleClickEvent(event);"/>
-      </tree>
-      <vbox>
-        <checkbox id="offlineState" label="&offlineState.label;" accesskey="&offlineState.accesskey;"/> 
-        <checkbox id="autoSelectLastProfile" label="&autoSelectLastProfile.label;" accesskey="&autoSelectLastProfile.accesskey;"/> 
-      </vbox>
-    </vbox>
-  </hbox>
-  
-</dialog>
deleted file mode 100644
--- a/profile/resources/content/selectLang.js
+++ /dev/null
@@ -1,115 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Communicator client code, released
- * March 31, 1998.
- *
- * The Initial Developer of the Original Code is Netscape
- * Communications Corporation. Portions created by Netscape are
- * Copyright (C) 1998-1999 Netscape Communications Corporation. All
- * Rights Reserved.
- *
- * Contributor(s):   Ben Goodger     (ben@netscape.com)
- *                   Joe Hewitt      (hewitt@netscape.com)
- *                   Blake Ross      (blaker@netscape.com)
- *                   Stephen Walker  (walk84@usa.net)
- *                   J.Betak         (jbetak@netscape.com)
- *
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * 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 ***** */
-
-
-function SelectListItem(listRef, itemValue)
-{
-
-  try {
-
-    var selectedItem;
-
-    if (itemValue) {
-      var elements = listRef.getElementsByAttribute("value", itemValue);
-      selectedItem = elements.item(0);
-    }
-
-    if (selectedItem)
-    {
-      listRef.selectedItem = selectedItem;
-      return true;
-    }
-    else
-      return false;
-  } 
-
-  catch(e)
-  {
-    return false;
-  }
-
-}
-
-
-function Startup()
-{
-  var defaultLanguage;
-  var languageList = document.getElementById("langList");
-  var selectedLanguage = window.arguments.length ? window.arguments[0] : null;
-
-  //get pref defaults
-  try
-  {
-    const nsIPrefLocalizedString = Components.interfaces.nsIPrefLocalizedString;
-    var prefBranch = Components.classes["@mozilla.org/preferences-service;1"]
-                               .getService(Components.interfaces.nsIPrefService)
-                               .getBranch("general.useragent.");
-    defaultLanguage = prefBranch.getComplexValue("locale", nsIPrefLocalizedString).data;
-  }
-
-  catch(e) 
-  {}
-
-  //persist previous user selection, highlight a default otherwise
-  if (!SelectListItem(languageList, selectedLanguage))
-    if (!SelectListItem(languageList, defaultLanguage))
-      languageList.selectedIndex = 0;
-
-}
-
-
-function onAccept()
-{
-  //cache language on the parent window
-  var languageList = document.getElementById("langList");
-  var selectedItem = languageList.selectedItems.length ? languageList.selectedItems[0] : null;
-
-  if (selectedItem) {
-    var langName = selectedItem.getAttribute("value");
-    var langStore = opener.document.getElementById("profileLanguage");
-
-    if (langStore)
-      langStore.setAttribute("data", langName);
-  }
-
-  return true;
-}
deleted file mode 100644
--- a/profile/resources/content/selectLang.xul
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://communicator/skin/"?>
-
-<!DOCTYPE dialog [
-<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
-%brandDTD;
-<!ENTITY % selectLangDTD SYSTEM "chrome://communicator/locale/profile/selectLang.dtd">
-%selectLangDTD;
-]>
-
-<dialog title="&langSelBox.title.label;"
-        style="width: 22em;"
-        onload="Startup();"
-        ondialogaccept="return onAccept();"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-  <script type="application/x-javascript" src="chrome://communicator/content/profile/selectLang.js"/>
-       
-    <label value="&langList.txt.label;" control="langList"/>
-
-    <separator class="thin" />
-    
-    <listbox id="langList" flex="1" rows="5" 
-          ref="urn:mozilla:locale:root" datasources="rdf:chrome"
-          sortResource="http://www.mozilla.org/rdf/chrome#name"
-          sortDirection="ascending">
-      
-      <template xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
-        <!-- This rule eliminates (obsolete) region packs from the language pack list -->
-        <rule chrome:localeType="region"/>
-        <!-- This rule displays only up to date language packs based on the localeVersion -->
-        <rule chrome:localeVersion="&lang.version;">
-          <listitem id="treechildren" uri="..." 
-                    label="rdf:http://www.mozilla.org/rdf/chrome#displayName"
-                    value="rdf:http://www.mozilla.org/rdf/chrome#name"/>
-        </rule>
-      </template>
-    </listbox>
-</dialog>        
deleted file mode 100644
--- a/profile/resources/jar.mn
+++ /dev/null
@@ -1,17 +0,0 @@
-comm.jar:
-	content/communicator/profile/createProfileWizard.js	(content/createProfileWizard.js)
-	content/communicator/profile/createProfileWizard.xul	(content/createProfileWizard.xul)
-	content/communicator/profile/migrateAllProfile.xul	(content/migrateAllProfile.xul)
-	content/communicator/profile/profileManager.js	(content/profileManager.js)
-	content/communicator/profile/profileSelection.js	(content/profileSelection.js)
-	content/communicator/profile/profileSelection.xul	(content/profileSelection.xul)
-	content/communicator/profile/selectLang.js	(content/selectLang.js)
-	content/communicator/profile/selectLang.xul	(content/selectLang.xul)
-
-en-US.jar:
-	locale/en-US/communicator/profile/createProfileWizard.dtd	(locale/en-US/createProfileWizard.dtd)
-	locale/en-US/communicator/profile/migration.properties	(locale/en-US/migration.properties)
-	locale/en-US/communicator/profile/profileManager.properties	(locale/en-US/profileManager.properties)
-	locale/en-US/communicator/profile/profileManagerMigrateAll.dtd	(locale/en-US/profileManagerMigrateAll.dtd)
-	locale/en-US/communicator/profile/profileSelection.dtd	(locale/en-US/profileSelection.dtd)
-	locale/en-US/communicator/profile/selectLang.dtd	(locale/en-US/selectLang.dtd)
deleted file mode 100644
--- a/profile/resources/locale/en-US/createProfileWizard.dtd
+++ /dev/null
@@ -1,23 +0,0 @@
-<!-- LOCALIZATION NOTE (window.title.label): Don't translate "&brandShortName" -->
-<!ENTITY window.title.label           "&brandShortName; Profile Manager">
-<!ENTITY newprofile.title             "Create Profile Wizard">
-<!ENTITY window.size                  "width: 47em; height: 32em;">
-
-<!-- First wizard page -->
-<!ENTITY profileCreationExplanation_1.text  "&brandShortName; stores information about your settings, preferences, bookmarks, and mail in your personal profile.">
-<!ENTITY profileCreationExplanation_2.text  "If you are sharing this copy of &brandShortName; with other users, you can use profiles to keep each user's information separate. To do this, each user should create his or her own profile.">
-<!ENTITY profileCreationExplanation_3.text  "If you are the only person using this copy of &brandShortName;, you must have at least one profile. If you would like, you can create multiple profiles for yourself to store different sets of settings and preferences. For example, you may want to have separate profiles for business and personal use.">
-<!ENTITY profileCreationExplanation_4.text  "To begin creating your profile, click Next.">
-
-<!-- Second wizard page -->
-<!ENTITY profileCreationIntro.text      "If you create several profiles you can tell them apart by the profile names. You may use the name provided here or use one of your own.">
-<!ENTITY profilePrompt.label            "Enter new profile name:">
-<!ENTITY profilePrompt.accesskey        "E">
-<!ENTITY profileDirExplanation.text     "Your user settings, preferences, bookmarks and mail will be stored in:">
-<!ENTITY profileDefaultName             "Default User">
-<!ENTITY button.choosefolder.label      "Choose Folder...">
-<!ENTITY button.choosefolder.accesskey  "C">
-<!ENTITY button.usedefault.label        "Use Default Folder">
-<!ENTITY button.usedefault.accesskey    "U">
-<!ENTITY button.langSelection.label     "Select Language...">
-<!ENTITY button.langSelection.accesskey "L">
deleted file mode 100644
--- a/profile/resources/locale/en-US/migrateAllProfile.dtd
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- extracted from pmMigrateAll.xul -->
-
-<!ENTITY title "Migrate All Profiles">
-<!ENTITY intro "Migrate all profiles? ">
-<!ENTITY ok.label "Ok">
-<!ENTITY cancel.label "Cancel">
deleted file mode 100644
--- a/profile/resources/locale/en-US/migration.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-# LOCALIZATION NOTE: Do not translate Unicode characters such as \u00a9
-dialogTitle=Confirm Migration
-confirmMigration=You are about to create a %S profile based on your Netscape 4 profile.\u000a\u000aThis will copy and convert some of your Netscape 4 files to work with %S.  Your Netscape 4 profile data will not be modified.
-migrate=Convert Profile
-manage=Manage Profiles...
-# mailDirName needs to be set to the same value as in 4.x
-# see bug #55449
-mailDirName=Mail
-# newsDirName needs to be set to the same value as in 4.x
-# see bug #55449
-newsDirName=News
-# see nsAppShellService::CheckAndRemigrateDefunctProfile()
-# for where the confirmRemigration entries are used
-# LOCALIZATION NOTE: Do not translate Unicode characters such as \u00a9
-confirmRemigration=A more recent Netscape 4.5+ version of this profile (which contains your bookmarks, email settings, address books and preferences) was found.\u000aWould you like to use the more recent profile?
-
-# No Space dialog
-noSpace.title=Not enough space to migrate.
-# LOCALIZATION NOTE: The \n is used to indicate a new paragraph
-noSpace.text=There is not enough space to migrate your profile.\nYou can free some space and retry, create a new empty profile or cancel.
-# LOCALIZATION NOTE: The & is used to indicate the access key
-retry.label=&Retry
-createNew.label=Create &New
deleted file mode 100644
--- a/profile/resources/locale/en-US/profileManager.properties
+++ /dev/null
@@ -1,44 +0,0 @@
-# LOCALIZATION NOTE: Do not translate <html:br/> 
-migratebeforestart=The profile you selected was created with a previous version of Netscape and must be copied and converted before you can use it with %brandShortName%.<html:br/><html:br/> Your original Netscape profile will not be altered. <html:br/><html:br/> Do you want to copy and convert this profile?
-migratebeforerename=The profile you selected was created with a previous version of Netscape and must be copied and converted to a %brandShortName% profile before it can be renamed.<html:br/><html:br/> Your original Netscape profile will not be altered. <html:br/><html:br/> Do you want to convert this profile?<html:br/><html:br/>
-migratebeforedelete=The profile you selected was created with a previous version of Netscape. %brandShortName% can remove this profile from the list of profiles that it maintains but you must remove it from your system using the version of Netscape that created it, or by hand.<html:br/><html:br/> Your original Netscape profile will not be altered. <html:br/><html:br/> Do you want to remove this profile from the list of profiles?<html:br/><html:br/> 
-
-
-
-migratetitle=Migrate Profile
-migrateallprofilestitle=Migrate All Profiles
-renameProfilePrompt=Rename the profile "%oldProfileName%" to:
-renameprofiletitle=Rename Profile
-
-chooseFolder=Choose Profile Folder
-deletetitle=Delete Profile
-delete4xprofile=The profile you selected was created with a previous version of Netscape. %S can remove this profile from the list of profiles that it maintains but you must remove it from your system using the version of Netscape that created it, or by hand.<html:br/><html:br/> Do you want to remove this profile from the list of profiles?<html:br/><html:br/>
-deleteprofile=Deleting a profile will remove the profile from the list of available profiles and cannot be undone.<html:br/>You may also choose to delete the profile data files, including your saved mail, settings, and certificates. This option will delete the folder "%S" and cannot be undone.<html:br/><html:br/>Would you like to delete the profile data files?
-deleteFiles=Delete Files
-dontDeleteFiles=Don't Delete Files
-
-pm_title=Manage User Profiles
-ps_title=Select User Profile
-
-intro_start=To access your personal profile, which contains your stored messages, settings and other personalized information, please choose your profile from the list, and click %S to begin your session.
-intro_switch=To switch to another profile, which contains stored messages, settings and other personalized information, please choose that profile from the list, and click %S to begin using that profile.
-
-pm_button=Back...
-ps_button=Manage Profiles...
-
-invalidChar=The character "%S" is not allowed in profile names. Please choose a different name.
-
-profileCreationFailed=Profile couldn't be created. Probably the chosen folder isn't writable.
-profileCreationFailedTitle=Profile Creation failed
-profileNameInvalidTitle=Invalid profile name
-profileNameEmpty=An empty profile name is not allowed.
-profileExists=A profile with this name already exists. Please choose another name.
-profileExistsTitle=Profile Exists
-profileFinishText=Click Finish to create this new profile.
-profDirMissing=%S cannot use the profile "%S" because the directory containing the profile cannot be found.<html:br/><html:br/> Please choose another profile or create a new one.
-profDirLocked=%S cannot use the profile "%S" because it is in use.<html:br/><html:br/> Please choose another profile or create a new one.
-profileSwitchFailed=%S cannot switch to profile "%S" automatically.<html:br/><html:br/>%S will now exit.<html:br/><html:br/>Please start %S again.
-
-
-sourceProfileDirMissing=This profile cannot be migrated because the directory containing the profile information could not be found. Choose another profile or create a new one.
-sourceProfileDirMissingTitle=Profile Directory Missing
deleted file mode 100644
--- a/profile/resources/locale/en-US/profileManagerMigrateAll.dtd
+++ /dev/null
@@ -1,4 +0,0 @@
-<!ENTITY title "Migrate All Profiles">
-<!ENTITY intro "Migrate all profiles? ">
-<!ENTITY ok.label "Ok">
-<!ENTITY cancel.label "Cancel">
deleted file mode 100644
--- a/profile/resources/locale/en-US/profileSelection.dtd
+++ /dev/null
@@ -1,75 +0,0 @@
-<!-- -*- Mode: SGML; indent-tabs-mode: nil; -*- -->
-<!--
-
- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is
- Netscape Communications Corporation.
- Portions created by the Initial Developer are Copyright (C) 1998
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
-   Ben Goodger (28/10/99)
-
- Alternatively, the contents of this file may be used under the terms of
- either of the GNU General Public License Version 2 or later (the "GPL"),
- or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the GPL or the LGPL. If you do not delete
- 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 ***** -->
-
-<!ENTITY            windowtitle.label     "Select User Profile">
-
-<!ENTITY            welcome.label         "Welcome to &brandShortName;">
-<!ENTITY            profilemanager.label  "&brandShortName; Profile Manager">
-
-<!ENTITY            profilename.label     "Profile Name:">
-
-<!ENTITY            password.label        "Password:">
-
-<!ENTITY            start.label           "Start &vendorShortName;">
-<!ENTITY            exit.label            "Exit">
-<!ENTITY            manage.label          "Manage Profiles...">
-<!ENTITY            manage.accesskey      "M">
-<!ENTITY            select.label          "Use Profile">
-
-<!ENTITY            availprofiles.label   "Available Profiles">
-
-<!ENTITY            deleteButton.label    "Delete Profile...">
-<!ENTITY            deleteButton.accesskey "D">
-<!ENTITY            renameButton.label    "Rename Profile...">
-<!ENTITY            renameButton.accesskey "R">
-<!ENTITY            newButton.label       "Create Profile...">
-<!ENTITY            newButton.accesskey   "C">
-
-<!-- manager entities -->
-<!ENTITY            pmTextA.label         "&brandShortName; stores information about your settings, preferences, bookmarks, stored messages and other user items in your user profile.">
-<!ENTITY            pmTextC.label         "You must select a profile, or create a new profile, the first time you start &brandShortName;.">
-<!ENTITY            pmTextB.label         "Indicates a profile created with a previous version of Netscape. These profiles must be copied and converted before they can be loaded with &brandShortName;. This is an automated process.">
-
-
-<!ENTITY            offlineState.label    "Work offline">
-<!ENTITY            offlineState.accesskey "o">
-
-<!ENTITY            autoSelectLastProfile.label    "Don't ask at startup">
-<!ENTITY            autoSelectLastProfile.accesskey "s">
deleted file mode 100644
--- a/profile/resources/locale/en-US/selectLang.dtd
+++ /dev/null
@@ -1,3 +0,0 @@
-
-<!ENTITY          langSelBox.title.label       "Language Selection">
-<!ENTITY          langList.txt.label           "Preferred Language">
deleted file mode 100644
--- a/profile/src/Makefile.in
+++ /dev/null
@@ -1,82 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either of the GNU General Public License Version 2 or later (the "GPL"),
-# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# 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 *****
-
-DEPTH		= ../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE		= profile
-LIBRARY_NAME	= profile_s
-MOZILLA_INTERNAL_API = 1
-
-REQUIRES	= xpcom \
-		  xpcom_obsolete \
-		  string \
-		  content \
-		  docshell \
-		  webbrwsr \
-		  dom \
-		  js \
-		  xpconnect \
-		  widget \
-		  necko \
-		  uriloader \
-		  intl \
-		  pref \
-		  prefmigr \
-		  appshell \
-		  appcomps \
-		  chrome \
-		  windowwatcher \
-		  profdirserviceprovider \
-		  embed_base \
-		  $(NULL)
-
-CPPSRCS		= 	nsProfile.cpp	\
-			nsProfileAccess.cpp	\
-			$(NULL)
-
-LOCAL_INCLUDES = -I$(srcdir)/../dirserviceprovider/src
-
-# we don't want the shared lib, but we want to force the creation of a static lib.
-FORCE_STATIC_LIB = 1
-
-include $(topsrcdir)/config/rules.mk
-
deleted file mode 100644
--- a/profile/src/nsProfile.cpp
+++ /dev/null
@@ -1,2634 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * 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 ***** */
-
-#include "nscore.h" 
-#include "nsProfile.h"
-#ifdef MOZ_PROFILELOCKING
-#include "nsProfileLock.h"
-#endif
-#include "nsIPrefService.h"
-#include "nsIPrefBranch.h"
-
-#include "pratom.h"
-#include "prmem.h"
-#include "plstr.h"
-#include "prenv.h"
-
-#include "nsIFactory.h"
-#include "nsIComponentManager.h"
-#include "nsIEnumerator.h"
-#include "nsXPIDLString.h"
-#include "nsEscape.h"
-#include "nsIURL.h"
-#include "nsNativeCharsetUtils.h"
-
-#include "prprf.h"
-
-#include "nsIIOService.h"
-#include "nsNetUtil.h"
-#include "nsPrefMigration.h"
-#include "nsIPrefMigration.h"
-#include "nsPrefMigrationCIDs.h"
-#include "nsFileStream.h"
-#include "nsIPromptService.h"
-#include "nsIStreamListener.h"
-#include "nsIServiceManager.h"
-#include "nsCOMPtr.h"
-#include "nsIModule.h"
-#include "nsIGenericFactory.h"
-#include "nsICookieService.h"
-#include "nsICategoryManager.h"
-#include "nsXPCOM.h"
-#include "nsISupportsPrimitives.h"
-#include "nsIDirectoryService.h"
-#include "nsDirectoryServiceDefs.h"
-#include "nsAppDirectoryServiceDefs.h"
-#include "nsIChromeRegistrySea.h"
-#include "nsIStringBundle.h"
-#include "nsIObserverService.h"
-#include "nsHashtable.h"
-#include "nsIAtom.h"
-#include "nsProfileDirServiceProvider.h"
-#include "nsISessionRoaming.h"
-
-// Interfaces Needed
-#include "nsIDocShell.h"
-#include "nsIWebBrowserChrome.h"
-#include "nsIBaseWindow.h"
-#include "nsIDialogParamBlock.h"
-#include "nsIDOMWindowInternal.h"
-#include "nsIWindowWatcher.h"
-#include "jsapi.h"
-#include "nsIJSContextStack.h"
-#include "nsEmbedCID.h"
-
-#if defined(XP_MAC) || defined(XP_MACOSX)
-#define OLD_REGISTRY_FILE_NAME "Netscape Registry"
-#elif defined(XP_WIN) || defined(XP_OS2)
-#define OLD_REGISTRY_FILE_NAME "nsreg.dat"
-#endif
-
-
-// A default profile name, in case automigration 4x profile fails
-#define DEFAULT_PROFILE_NAME           (NS_LITERAL_STRING("default").get())
-
-#define PROFILE_SELECTION_URL          "chrome://communicator/content/profile/profileSelection.xul"
-#define PROFILE_SELECTION_CMD_LINE_ARG "-SelectProfile"
-#define PROFILE_MANAGER_URL            "chrome://communicator/content/profile/profileSelection.xul?manage=true"
-#define PROFILE_MANAGER_CMD_LINE_ARG   "-ProfileManager"
-#define PROFILE_WIZARD_URL             "chrome://communicator/content/profile/createProfileWizard.xul"
-#define PROFILE_WIZARD_CMD_LINE_ARG    "-ProfileWizard"
-#define INSTALLER_CMD_LINE_ARG         "-installer"
-#define CREATE_PROFILE_CMD_LINE_ARG    "-CreateProfile"
-#define PROFILE_CMD_LINE_ARG "-P"   
-#define UILOCALE_CMD_LINE_ARG "-UILocale"   
-#define CONTENTLOCALE_CMD_LINE_ARG "-contentLocale"   
-
-#define PREF_CONFIRM_AUTOMIGRATION     "profile.confirm_automigration"
-#define PREF_AUTOMIGRATION             "profile.allow_automigration"
-#define PREF_MIGRATE_ALL               "profile.migrate_all"
-#define PREF_MIGRATION_BEHAVIOR        "profile.migration_behavior"
-#define PREF_MIGRATION_DIRECTORY       "profile.migration_directory"
-
-#if defined (XP_MAC)
-#define CHROME_STYLE nsIWebBrowserChrome::CHROME_WINDOW_BORDERS | nsIWebBrowserChrome::CHROME_WINDOW_CLOSE | nsIWebBrowserChrome::CHROME_CENTER_SCREEN
-#else /* the rest */
-#define CHROME_STYLE nsIWebBrowserChrome::CHROME_ALL | nsIWebBrowserChrome::CHROME_CENTER_SCREEN
-#endif 
-
-const char* kDefaultOpenWindowParams = "centerscreen,chrome,modal,titlebar";
-
-const char* kBrandBundleURL = "chrome://branding/locale/brand.properties";
-const char* kMigrationBundleURL = "chrome://communicator/locale/profile/migration.properties";
-
-// we want everyone to have the debugging info to the console for now
-// to help track down profile manager problems
-// when we ship, we'll turn this off
-#undef DEBUG_profile_verbose
-#ifdef DEBUG_seth
-#define DEBUG_profile_verbose 1
-#endif
-
-
-// ProfileAccess varaible (gProfileDataAccess) to access registry operations
-// gDataAccessInstCount is used to keep track of instance count to activate
-// destructor at the right time (count == 0)
-static nsProfileAccess*    gProfileDataAccess = nsnull;
-static PRInt32          gInstanceCount = 0;
-
-// Profile database to remember which profile has been
-// created with UILocale and contentLocale on profileManager
-static nsHashtable *gLocaleProfiles = nsnull;
-static nsProfileDirServiceProvider *gDirServiceProvider = nsnull;
-
-// IID and CIDs of all the services needed
-static NS_DEFINE_CID(kPrefMigrationCID, NS_PREFMIGRATION_CID);
-static NS_DEFINE_CID(kPrefConverterCID, NS_PREFCONVERTER_CID);
-
-#define NS_SESSIONROAMING_CONTRACTID "@mozilla.org/profile/session-roaming;1"
-
-
-/*
-    Copies the contents of srcDir into destDir.
-    destDir will be created if it doesn't exist.
-*/
-
-static
-nsresult RecursiveCopy(nsIFile* srcDir, nsIFile* destDir)
-{
-    nsresult rv;
-    PRBool isDir;
-    
-    rv = srcDir->IsDirectory(&isDir);
-    if (NS_FAILED(rv)) return rv;
-	if (!isDir) return NS_ERROR_INVALID_ARG;
-
-    PRBool exists;
-    rv = destDir->Exists(&exists);
-	if (NS_SUCCEEDED(rv) && !exists)
-		rv = destDir->Create(nsIFile::DIRECTORY_TYPE, 0775);
-	if (NS_FAILED(rv)) return rv;
-
-    PRBool hasMore = PR_FALSE;
-    nsCOMPtr<nsISimpleEnumerator> dirIterator;
-    rv = srcDir->GetDirectoryEntries(getter_AddRefs(dirIterator));
-    if (NS_FAILED(rv)) return rv;
-    
-    rv = dirIterator->HasMoreElements(&hasMore);
-    if (NS_FAILED(rv)) return rv;
-    
-    nsCOMPtr<nsIFile> dirEntry;
-    
-	while (hasMore)
-	{
-		rv = dirIterator->GetNext((nsISupports**)getter_AddRefs(dirEntry));
-		if (NS_SUCCEEDED(rv))
-		{
-		    rv = dirEntry->IsDirectory(&isDir);
-		    if (NS_SUCCEEDED(rv))
-		    {
-		        if (isDir)
-		        {
-		            nsCOMPtr<nsIFile> destClone;
-		            rv = destDir->Clone(getter_AddRefs(destClone));
-		            if (NS_SUCCEEDED(rv))
-		            {
-		                nsCOMPtr<nsILocalFile> newChild(do_QueryInterface(destClone));
-		                nsCAutoString leafName;
-		                dirEntry->GetNativeLeafName(leafName);
-		                newChild->AppendRelativeNativePath(leafName);
-		                rv = RecursiveCopy(dirEntry, newChild);
-		            }
-		        }
-		        else
-		            rv = dirEntry->CopyToNative(destDir, EmptyCString());
-		    }
-		
-		}
-        rv = dirIterator->HasMoreElements(&hasMore);
-        if (NS_FAILED(rv)) return rv;
-	}
-
-	return rv;
-}
-
-
-/*
- * Constructor/Destructor
- */
-nsProfile::nsProfile()
-{
-    mStartingUp = PR_FALSE;
-    mAutomigrate = PR_FALSE;
-    mOutofDiskSpace = PR_FALSE;
-    mDiskSpaceErrorQuitCalled = PR_FALSE;
-    mCurrentProfileAvailable = PR_FALSE;
-
-    mIsUILocaleSpecified = PR_FALSE;
-    mIsContentLocaleSpecified = PR_FALSE;
-    
-    mShutdownProfileToreDownNetwork = PR_FALSE;
-    
-    mProfileChangeVetoed = PR_FALSE;
-    mProfileChangeFailed = PR_FALSE;
-}
-
-nsProfile::~nsProfile() 
-{
-#if defined(DEBUG_profile_verbose)
-    printf("~nsProfile \n");
-#endif
-
-   if (--gInstanceCount == 0) {
-        
-      delete gProfileDataAccess;
-      delete gLocaleProfiles;
-      NS_IF_RELEASE(gDirServiceProvider);
-    }
-}
-
-nsresult
-nsProfile::Init()
-{
-    nsresult rv = NS_OK;
-    
-    if (gInstanceCount++ == 0) {
-        gProfileDataAccess = new nsProfileAccess;
-        if (!gProfileDataAccess)
-            return NS_ERROR_OUT_OF_MEMORY;
-        gLocaleProfiles = new nsHashtable();
-        if (!gLocaleProfiles)
-            return NS_ERROR_OUT_OF_MEMORY;
-
-        rv = NS_NewProfileDirServiceProvider(PR_FALSE, &gDirServiceProvider);
-        if (NS_SUCCEEDED(rv))
-            rv = gDirServiceProvider->Register();
-    }
-    return rv;
-}
-
-/*
- * nsISupports Implementation
- */
-NS_IMPL_THREADSAFE_ADDREF(nsProfile)
-NS_IMPL_THREADSAFE_RELEASE(nsProfile)
-
-NS_INTERFACE_MAP_BEGIN(nsProfile)
-    NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIProfile)
-    NS_INTERFACE_MAP_ENTRY(nsIProfile)
-    NS_INTERFACE_MAP_ENTRY(nsIProfileInternal)
-    NS_INTERFACE_MAP_ENTRY(nsIProfileChangeStatus)
-NS_INTERFACE_MAP_END
-
-/*
- * nsIProfile Implementation
- */
-
-NS_IMETHODIMP
-nsProfile::GetAutomigrate(PRBool *aAutomigrate)
-{
-    NS_ENSURE_ARG_POINTER(aAutomigrate);
-
-    *aAutomigrate = mAutomigrate;
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-nsProfile::SetAutomigrate(PRBool aAutomigrate)
-{
-    mAutomigrate = aAutomigrate;
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-nsProfile::StartupWithArgs(nsICmdLineService *cmdLineArgs, PRBool canInteract)
-{
-    nsresult rv;
-
-    struct ScopeFlag
-    {
-        ScopeFlag(PRBool *flagPtr) : mFlagPtr(flagPtr)
-        { *mFlagPtr = PR_TRUE; }
-
-        ~ScopeFlag()
-        { *mFlagPtr = PR_FALSE; }
-
-        PRBool *mFlagPtr;
-    };
-
-    // initializations for profile manager
-    PRBool profileDirSet = PR_FALSE;
-    nsCString profileURLStr("");
-
-#ifdef DEBUG_profile_verbose
-    printf("Profile Manager : Profile Wizard and Manager activites : Begin\n");
-#endif
-
-    ScopeFlag startupFlag(&mStartingUp);
-
-    if (cmdLineArgs)
-        rv = ProcessArgs(cmdLineArgs, canInteract, &profileDirSet, profileURLStr);
-
-    // This boolean is set only when an automigrated user runs out of disk space
-    // and chooses to cancel further operations from the dialogs presented...
-    if (mDiskSpaceErrorQuitCalled)
-        return NS_ERROR_FAILURE;
-
-    if (!profileDirSet) {
-        rv = LoadDefaultProfileDir(profileURLStr, canInteract);
-
-        if (NS_FAILED(rv)) return rv;
-    }
-
-    // Ensure that by this point we have a current profile.
-    // If -CreateProfile was used, we won't, and we're supposed to exit.
-    nsXPIDLString currentProfileStr;
-    rv = GetCurrentProfile(getter_Copies(currentProfileStr));
-    if (NS_FAILED(rv) || (*(const PRUnichar*)currentProfileStr == 0)) {
-        return NS_ERROR_ABORT;
-    }
-
-
-    // check UILocale is specified on profileManager, otherwise,
-    // when -UILocale option is specified, install the UILocale
-
-    // -UILocale or -contentLocale is not specified
-    if (mIsUILocaleSpecified == PR_FALSE && mIsContentLocaleSpecified == PR_FALSE) {
-        return NS_OK;
-    }
-
-    nsCOMPtr<nsIFile> profileDir;
-
-    rv = GetCurrentProfileDir(getter_AddRefs(profileDir));
-    if (NS_FAILED(rv)) return rv;
-
-    nsCAutoString pathBuf;
-    rv = profileDir->GetNativePath(pathBuf);
-    if (NS_FAILED(rv)) return rv;
-
-    // -UILocale or -contentLocale has been specified, but
-    // user has selected UILocale and contentLocale for this profile
-    // on profileManager
-    // We should not set here
-    nsCStringKey key(pathBuf);
-    if (NS_PTR_TO_INT32(gLocaleProfiles->Get(&key)) == PR_TRUE) {
-#ifdef DEBUG_profile_verbose
-        printf(" already set UILocale and contentLocale: %s\n", pathBuf.get());
-        printf(" will not install locale\n");
-#endif
-        return NS_OK;
-    }
-    gLocaleProfiles->Remove(&key);
-
-    nsCOMPtr<nsIChromeRegistrySea> chromeRegistry =
-        do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &rv);
-    if (NS_FAILED(rv)) return rv;
-
-    // Install to the profile
-    nsCAutoString fileStr;
-    rv = NS_GetURLSpecFromFile(profileDir, fileStr);
-    if (NS_FAILED(rv)) return rv;
-
-    // NEED TO FIX: when current UILocale and contentLocale are same with specified locales,
-    // we shouldn't install them again here. But packageRegistry->GetSelectedLocale() doesn't
-    // work here properly. It always returns global and global-region of default not current
-    // profile
-    if (!mUILocaleName.IsEmpty()) {
-#ifdef DEBUG_profile_verbose
-        printf(" install new UILocaleName: %s\n", mUILocaleName.get());
-#endif
-        rv = chromeRegistry->SelectLocaleForProfile(mUILocaleName,
-                                          NS_ConvertUTF8toUTF16(fileStr).get());
-        if (NS_FAILED(rv)) return rv;
-    }
-
-    if (!mContentLocaleName.IsEmpty()) {
-#ifdef DEBUG_profile_verbose
-        printf(" install new mContentLocaleName: %s\n", mContentLocaleName.get());
-#endif
-        rv = chromeRegistry->SelectLocaleForProfile(mContentLocaleName,
-                                          NS_ConvertUTF8toUTF16(fileStr).get());
-        if (NS_FAILED(rv)) return rv;
-    }
-
-#ifdef DEBUG_profile_verbose
-    printf("Profile Manager : Profile Wizard and Manager activites : End\n");
-#endif
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-nsProfile::GetIsStartingUp(PRBool *aIsStartingUp)
-{
-    NS_ENSURE_ARG_POINTER(aIsStartingUp);
-    *aIsStartingUp = mStartingUp;
-    return NS_OK;
-}
-
-nsresult
-nsProfile::LoadDefaultProfileDir(nsCString & profileURLStr, PRBool canInteract)
-{
-    nsresult rv;
-    nsCOMPtr<nsIURI> profileURL;
-    PRInt32 numProfiles=0;
-  
-    GetProfileCount(&numProfiles);
-
-    if (profileURLStr.IsEmpty())
-    {
-        nsCOMPtr<nsIPrefBranch> prefBranch;
-        nsCOMPtr<nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
-        if (NS_FAILED(rv)) return rv;
-        rv = prefs->GetBranch(nsnull, getter_AddRefs(prefBranch));
-        if (NS_FAILED(rv)) return rv;
-    
-        // If this flag is TRUE, it makes the multiple profile case
-        // just like the single profile case - the profile will be
-        // set to that returned by GetCurrentProfile(). It will prevent
-        // the profile selection dialog from being shown when we have
-        // multiple profiles.
-        
-        PRBool startWithLastUsedProfile = PR_FALSE;
-
-        // But first, make sure this app supports this.
-        PRBool cantAutoSelect;
-        rv = prefBranch->GetBoolPref("profile.manage_only_at_launch", &cantAutoSelect);
-        if (NS_SUCCEEDED(rv) && !cantAutoSelect)
-          GetStartWithLastUsedProfile(&startWithLastUsedProfile);
-        
-        // This means that there was no command-line argument to force
-        // profile UI to come up. But we need the UI anyway if there
-        // are no profiles yet, or if there is more than one.
-        if (numProfiles == 0)
-        {
-            rv = CreateDefaultProfile();
-            if (NS_FAILED(rv)) return rv;
-            // Will get set in call to SetCurrentProfile() below
-        }
-        else if (numProfiles == 1 || startWithLastUsedProfile)
-        {
-            // If we get here and the 1 profile is the current profile,
-            // which can happen with QuickLaunch, there's no need to do
-            // any futher work.
-            if (mCurrentProfileAvailable)
-               return NS_OK;
-
-            // Make sure the profile dir exists. If not, we need the UI
-            nsCOMPtr<nsIFile> curProfileDir;
-            PRBool exists = PR_FALSE;
-            
-            rv = GetCurrentProfileDir(getter_AddRefs(curProfileDir));
-            if (NS_SUCCEEDED(rv))
-                rv = curProfileDir->Exists(&exists);
-            if (NS_FAILED(rv) || !exists)
-                profileURLStr = PROFILE_MANAGER_URL; 
-            if (exists)
-            {
-#ifdef MOZ_PROFILELOCKING
-                // If the profile is locked, we need the UI
-                nsCOMPtr<nsILocalFile> localFile(do_QueryInterface(curProfileDir));
-                nsProfileLock tempLock;
-                rv = tempLock.Lock(localFile, nsnull);
-                if (NS_FAILED(rv))
-                    profileURLStr = PROFILE_MANAGER_URL;
-#endif
-            }
-        }
-        else
-            profileURLStr = PROFILE_SELECTION_URL;
-    }
-
-    if (!profileURLStr.IsEmpty())
-    {
-        if (!canInteract) return NS_ERROR_PROFILE_REQUIRES_INTERACTION;
-
-        nsCOMPtr<nsIWindowWatcher> windowWatcher(do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv));
-        if (NS_FAILED(rv)) return rv;
-
-        nsCOMPtr<nsIDialogParamBlock> ioParamBlock(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID, &rv));
-        if (NS_FAILED(rv)) return rv;
-
-        // String0  -> mode
-        // Int0    <-  result code (1 == OK, 0 == Cancel)
-
-        ioParamBlock->SetNumberStrings(1);
-        ioParamBlock->SetString(0, NS_LITERAL_STRING("startup").get());
-
-        nsCOMPtr<nsIDOMWindow> newWindow;
-        rv = windowWatcher->OpenWindow(nsnull,
-                                       profileURLStr.get(),
-                                       "_blank",
-                                       kDefaultOpenWindowParams,
-                                       ioParamBlock,
-                                       getter_AddRefs(newWindow));
-        if (NS_FAILED(rv)) return rv;
-        PRInt32 dialogConfirmed;
-        ioParamBlock->GetInt(0, &dialogConfirmed);
-        if (dialogConfirmed == 0) return NS_ERROR_ABORT;
-    }
-
-    nsXPIDLString currentProfileStr;    
-    rv = GetCurrentProfile(getter_Copies(currentProfileStr));
-    if (NS_FAILED(rv)) return rv;
-
-    // if at this point we have a current profile but it is not set, set it
-    if (!mCurrentProfileAvailable) {
-        rv = SetCurrentProfile(currentProfileStr);
-        if (NS_FAILED(rv)) return rv;
-    }
-
-    return NS_OK;
-}
-
-nsresult
-nsProfile::ConfirmAutoMigration(PRBool canInteract, PRBool *confirmed)
-{
-    NS_ENSURE_ARG_POINTER(confirmed);
-    nsCOMPtr<nsIPrefBranch> prefBranch;
-    *confirmed = PR_FALSE;
-    nsresult rv;
-    
-    // First check PREF_CONFIRM_AUTOMIGRATION.
-    // If FALSE, we go ahead and migrate without asking.
-    PRBool confirmAutomigration = PR_TRUE;
-    nsCOMPtr<nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
-    if (NS_FAILED(rv)) return rv;
-    rv = prefs->GetBranch(nsnull, getter_AddRefs(prefBranch));
-    if (NS_FAILED(rv)) return rv;
-
-    (void)prefBranch->GetBoolPref(PREF_CONFIRM_AUTOMIGRATION, &confirmAutomigration);
-    if (!confirmAutomigration) {
-        *confirmed = PR_TRUE;
-        return NS_OK;
-    }
-    
-    // If allowed, put up a confirm dialog and ask the user
-    if (!canInteract)
-        return NS_ERROR_PROFILE_REQUIRES_INTERACTION;
-
-    nsCOMPtr<nsIStringBundleService> stringBundleService(do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv));
-    if (NS_FAILED(rv)) return rv;
-
-    nsCOMPtr<nsIStringBundle> migrationBundle, brandBundle;
-    rv = stringBundleService->CreateBundle(kMigrationBundleURL, getter_AddRefs(migrationBundle));
-    if (NS_FAILED(rv)) return rv;
-    rv = stringBundleService->CreateBundle(kBrandBundleURL, getter_AddRefs(brandBundle));
-    if (NS_FAILED(rv)) return rv;
-    
-    nsXPIDLString brandName;
-    rv = brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(), getter_Copies(brandName));
-    if (NS_FAILED(rv)) return rv;
-
-    nsXPIDLString msgString, dialogTitle, button0Title, button1Title;
-    const PRUnichar *formatStrings[] = { brandName.get(), brandName.get() };
-    rv = migrationBundle->FormatStringFromName(NS_LITERAL_STRING("confirmMigration").get(),
-                                                 formatStrings, 2, getter_Copies(msgString));
-    if (NS_FAILED(rv)) return rv;
-    
-    rv = migrationBundle->GetStringFromName(NS_LITERAL_STRING("dialogTitle").get(), getter_Copies(dialogTitle));
-    if (NS_FAILED(rv)) return rv;
-    rv = migrationBundle->GetStringFromName(NS_LITERAL_STRING("migrate").get(), getter_Copies(button0Title));
-    if (NS_FAILED(rv)) return rv;
-    rv = migrationBundle->GetStringFromName(NS_LITERAL_STRING("manage").get(), getter_Copies(button1Title));
-    if (NS_FAILED(rv)) return rv;
-    
-    nsCOMPtr<nsIPromptService> promptService(do_GetService(NS_PROMPTSERVICE_CONTRACTID, &rv));
-    if (NS_FAILED(rv)) return rv;
-    PRInt32 buttonPressed;
-    rv = promptService->ConfirmEx(nsnull, dialogTitle.get(), msgString.get(),
-                                  (nsIPromptService::BUTTON_POS_0 * nsIPromptService::BUTTON_TITLE_IS_STRING) +
-                                  (nsIPromptService::BUTTON_POS_1 * nsIPromptService::BUTTON_TITLE_IS_STRING),
-                                  button0Title, button1Title, nsnull,
-                                  nsnull, nsnull, &buttonPressed);
-    if (NS_FAILED(rv)) return rv;
-    *confirmed = (buttonPressed == 0);
-    return NS_OK;
-}
-
-nsresult 
-nsProfile::AutoMigrate()
-{
-    nsresult rv = NS_OK;
-    // automatically migrate the one 4.x profile
-    rv = MigrateAllProfiles();
-
-    // Create a default profile if automigration failed for reasons
-    // other than out of disk space case...
-    if (NS_FAILED(rv) && !mOutofDiskSpace) 
-    {
-#ifdef DEBUG_profile
-        printf("AutoMigration failed. Let's create a default 5.0 profile.\n");
-#endif
-        
-        rv = CreateDefaultProfile();
-        if (NS_FAILED(rv)) return rv;
-    }   
-
-    gProfileDataAccess->mProfileDataChanged = PR_TRUE;
-    gProfileDataAccess->UpdateRegistry(nsnull);
-
-    return rv;
-}
-
-nsresult
-nsProfile::ProcessArgs(nsICmdLineService *cmdLineArgs,
-                       PRBool canInteract,
-                       PRBool* profileDirSet,
-                       nsCString & profileURLStr)
-{
-    NS_ASSERTION(cmdLineArgs, "Invalid cmdLineArgs");   
-    NS_ASSERTION(profileDirSet, "Invalid profileDirSet");   
-
-    nsresult rv;
-    nsXPIDLCString cmdResult;
-    nsCOMPtr<nsILocalFile> currProfileDir;
-
-	// keep track of if the user passed us any profile related command line args
-	// if they did, we won't force migration
-	PRBool foundProfileCommandArg = PR_FALSE;
-
-#ifdef DEBUG_profile_verbose
-    printf("Profile Manager : Command Line Options : Begin\n");
-#endif
- 
-    // check for command line arguments for profile manager
-    // -UILocale command
-    rv = cmdLineArgs->GetCmdLineValue(UILOCALE_CMD_LINE_ARG, getter_Copies(cmdResult));
-    if (NS_SUCCEEDED(rv))
-    {
-        if (cmdResult) {
-	    mIsUILocaleSpecified = PR_TRUE;
-            mUILocaleName = cmdResult;
-        }
-    }
-
-    // -contentLocale command
-    rv = cmdLineArgs->GetCmdLineValue(CONTENTLOCALE_CMD_LINE_ARG, getter_Copies(cmdResult));
-    if (NS_SUCCEEDED(rv))
-    {
-        if (cmdResult) {
-            mIsContentLocaleSpecified = PR_TRUE;
-            mContentLocaleName = cmdResult;
-        }
-    }
-
-    // -P command line option works this way:
-    // apprunner -P profilename 
-    // runs the app using the profile <profilename> 
-    // remembers profile for next time
-    rv = cmdLineArgs->GetCmdLineValue(PROFILE_CMD_LINE_ARG, getter_Copies(cmdResult));
-    if (NS_SUCCEEDED(rv))
-    {
-        if (cmdResult) {
-            foundProfileCommandArg = PR_TRUE;
-            nsAutoString currProfileName; 
-            rv = NS_CopyNativeToUnicode(cmdResult, currProfileName); 
-            NS_ASSERTION(NS_SUCCEEDED(rv), "failed to convert ProfileName to unicode");
- 
-#ifdef DEBUG_profile
-            printf("ProfileName : %s\n", (const char*)cmdResult);
-#endif /* DEBUG_profile */
-            PRBool exists;
-            rv = ProfileExists(currProfileName.get(), &exists);
-            if (NS_FAILED(rv)) return rv;            
-            
-            if (!exists) {
-                PRInt32 num5xProfiles = 0;
-                PRInt32 num4xProfiles = 0;
-
-                GetProfileCount(&num5xProfiles);
-                Get4xProfileCount(&num4xProfiles);
-
-                if (num5xProfiles == 0 && num4xProfiles == 0) {
-                    profileURLStr = PROFILE_WIZARD_URL;
-                }
-                else if (num5xProfiles > 0) {
-                    profileURLStr = PROFILE_SELECTION_URL;
-                }
-                else if (num4xProfiles > 0) {
-                    profileURLStr = PROFILE_MANAGER_URL;
-                }
-                *profileDirSet = PR_FALSE;
-            }
-            else {
-                rv = SetCurrentProfile(currProfileName.get());
-                if (NS_SUCCEEDED(rv))
-                    *profileDirSet = PR_TRUE;
-            }
-        }
-    }
-
-    // -CreateProfile command line option works this way:
-    // apprunner -CreateProfile profilename 
-    // creates a new profile named <profilename> and sets the directory to your CWD 
-    // runs app using that profile 
-    // remembers profile for next time 
-    //                         - OR -
-    // apprunner -CreateProfile "profilename profiledir" 
-    // creates a new profile named <profilename> and sets the directory to <profiledir> 
-    // runs app using that profile 
-    // remembers profile for next time
-
-    rv = cmdLineArgs->GetCmdLineValue(CREATE_PROFILE_CMD_LINE_ARG, getter_Copies(cmdResult));
-    if (NS_SUCCEEDED(rv))
-    {
-        if (cmdResult) {
-
-#ifdef DEBUG_profile_verbose
-            printf("profileName & profileDir are: %s\n", (const char*)cmdResult);
-#endif
-            foundProfileCommandArg = PR_TRUE;
-            nsAutoString currProfileName; 
- 
-            char *tmpStr;
-            rv = NS_CopyNativeToUnicode(
-                 nsDependentCString(nsCRT::strtok(cmdResult.BeginWriting(), " ", &tmpStr)),
-                                    currProfileName);
-            NS_ASSERTION(NS_SUCCEEDED(rv), "failed to convert ProfileName to unicode");
-
-            char *currProfileDirString = nsCRT::strtok(tmpStr, " ", &tmpStr); 
-            if (currProfileDirString && *currProfileDirString) {
-                rv = NS_NewNativeLocalFile(nsDependentCString(currProfileDirString), 
-                     PR_TRUE, getter_AddRefs(currProfileDir));
-                NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
-            }
-            else {
-                // No directory name provided. Place it in
-                // NS_APP_USER_PROFILES_ROOT_DIR
-                nsCOMPtr<nsIProperties> directoryService(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv));
-                if (NS_FAILED(rv)) return rv;
-                rv = directoryService->Get(NS_APP_USER_PROFILES_ROOT_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(currProfileDir));
-                if (NS_FAILED(rv)) return rv;
-            }
-
-            nsAutoString currProfilePath;
-            currProfileDir->GetPath(currProfilePath);
-            rv = CreateNewProfile(currProfileName.get(), currProfilePath.get(), nsnull, PR_TRUE);
-            if (NS_SUCCEEDED(rv)) {
-                *profileDirSet = PR_TRUE;
-                mCurrentProfileAvailable = PR_TRUE;
-                gProfileDataAccess->SetCurrentProfile(currProfileName.get());
-
-                // Load new profile prefs for the sake of tinderbox scripts
-                // which assume prefs.js exists after -CreateProfile.
-                nsCOMPtr<nsIFile> newProfileDir;
-                GetProfileDir(currProfileName.get(), getter_AddRefs(newProfileDir));
-                if (newProfileDir) {
-                  nsCOMPtr<nsIFile> localDir;
-                  GetLocalProfileDir(currProfileName.get(), getter_AddRefs(localDir));
-                  gDirServiceProvider->SetProfileDir(newProfileDir, localDir);
-                }
-                rv = LoadNewProfilePrefs();
-                gProfileDataAccess->mProfileDataChanged = PR_TRUE;
-                gProfileDataAccess->UpdateRegistry(nsnull);
-            }
-            rv = ForgetCurrentProfile();
-            if (NS_FAILED(rv)) return rv;
-        }
-    }
-
-    // Start Profile Manager
-    rv = cmdLineArgs->GetCmdLineValue(PROFILE_MANAGER_CMD_LINE_ARG, getter_Copies(cmdResult));
-    if (NS_SUCCEEDED(rv))
-    {        
-        if (cmdResult) {
-			foundProfileCommandArg = PR_TRUE;
-            profileURLStr = PROFILE_MANAGER_URL;
-        }
-    }
-    
-    // Start Profile Selection
-    rv = cmdLineArgs->GetCmdLineValue(PROFILE_SELECTION_CMD_LINE_ARG, getter_Copies(cmdResult));
-    if (NS_SUCCEEDED(rv))
-    {        
-        if (cmdResult) {
-			foundProfileCommandArg = PR_TRUE;
-            profileURLStr = PROFILE_SELECTION_URL;
-        }
-    }
-    
-    
-    // Start Profile Wizard
-    rv = cmdLineArgs->GetCmdLineValue(PROFILE_WIZARD_CMD_LINE_ARG, getter_Copies(cmdResult));
-    if (NS_SUCCEEDED(rv))
-    {        
-        if (cmdResult) {
-			foundProfileCommandArg = PR_TRUE;
-            profileURLStr = PROFILE_WIZARD_URL;
-        }
-    }
-
-	PRBool forceMigration = PR_FALSE;
-	if (!foundProfileCommandArg) {
-		rv = gProfileDataAccess->DetermineForceMigration(&forceMigration);
-		NS_ASSERTION(NS_SUCCEEDED(rv),"failed to determine if we should force migration");
-	}
-
-    nsCOMPtr<nsIPrefBranch> prefBranch;
-   
-    // First check PREF_AUTOMIGRATION. 
-    PRBool allowAutoMigration = PR_TRUE;
-    nsCOMPtr<nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
-    if (NS_FAILED(rv)) return rv;
-    rv = prefs->GetBranch(nsnull, getter_AddRefs(prefBranch));
-    if (NS_FAILED(rv)) return rv;
-
-    (void)prefBranch->GetBoolPref(PREF_AUTOMIGRATION, &allowAutoMigration);
-
-    // Start Migaration activity
-    rv = cmdLineArgs->GetCmdLineValue(INSTALLER_CMD_LINE_ARG, getter_Copies(cmdResult));
-    if (allowAutoMigration && (NS_SUCCEEDED(rv) || forceMigration))
-    {        
-        if (cmdResult || forceMigration) {
-        PRBool migrateAll = PR_FALSE;
-        (void)prefBranch->GetBoolPref(PREF_MIGRATE_ALL, &migrateAll);
-
-            rv = MigrateProfileInfo();
-            if (NS_FAILED(rv)) return rv;
-
-            PRInt32 num4xProfiles = 0;
-            rv = Get4xProfileCount(&num4xProfiles);
-            if (NS_FAILED(rv)) return rv;
-            
-            PRInt32 numProfiles = 0;
-            GetProfileCount(&numProfiles);
-            if (num4xProfiles == 0 && numProfiles == 0) {
-                // Let us create a default 5.0 profile
-                CreateDefaultProfile();
-                if (NS_FAILED(rv)) return rv;
-            }
-            else if (num4xProfiles == 0 && numProfiles == 1) {
-                profileURLStr = "";
-            }
-            else if ((num4xProfiles == 1 || migrateAll) && numProfiles == 0) {
-                PRBool confirmed = PR_FALSE;
-                if (NS_SUCCEEDED(ConfirmAutoMigration(canInteract, &confirmed)) && confirmed)
-                    AutoMigrate();
-                else
-                    profileURLStr = PROFILE_MANAGER_URL;
-            }
-            else if (numProfiles > 1)
-            {
-                profileURLStr = PROFILE_SELECTION_URL;
-            }
-            else {
-                // show the profile manager
-                profileURLStr = PROFILE_MANAGER_URL;
-            }
-        }
-    }
-
-#ifdef DEBUG_profile_verbose
-    printf("Profile Manager : Command Line Options : End\n");
-#endif
-
-    return NS_OK;
-}
-
-
-/*
- * Getters
- */
-
-// Gets the profiles directory for a given profile
-// Sets the given profile to be a current profile
-NS_IMETHODIMP nsProfile::GetProfileDir(const PRUnichar *profileName, nsIFile **profileDir)
-{
-    NS_ENSURE_ARG(profileName);   
-    NS_ENSURE_ARG_POINTER(profileDir);
-    *profileDir = nsnull;
-
-    nsresult rv = NS_OK;
-
-#if defined(DEBUG_profile_verbose)
-    printf("ProfileManager : GetProfileDir\n");
-#endif
-
-    ProfileStruct    *aProfile;
-
-    rv = gProfileDataAccess->GetValue(profileName, &aProfile);
-    if (NS_FAILED(rv)) return rv;
-
-	if (aProfile == nsnull)
-		return NS_ERROR_FAILURE;
-
-    nsCOMPtr<nsILocalFile>aProfileDir;
-    rv = aProfile->GetResolvedProfileDir(getter_AddRefs(aProfileDir));
-    if (NS_SUCCEEDED(rv) && aProfileDir)
-    {
-#ifdef XP_MAC
-        PRBool exists;
-        rv = aProfileDir->Exists(&exists);
-        if (NS_FAILED(rv)) return rv;
-        if (exists) {
-            PRBool inTrash;
-            nsCOMPtr<nsIFile> trashFolder;
-                            
-            rv = NS_GetSpecialDirectory(NS_MAC_TRASH_DIR, getter_AddRefs(trashFolder));
-            if (NS_FAILED(rv)) return rv;
-            rv = trashFolder->Contains(aProfileDir, PR_TRUE, &inTrash);
-            if (NS_FAILED(rv)) return rv;
-            if (inTrash) {
-                aProfileDir = nsnull;
-                rv = NS_ERROR_FILE_NOT_FOUND;
-            }  
-        }
-#endif
-        *profileDir = aProfileDir;
-        NS_IF_ADDREF(*profileDir);
-    }    
-	delete aProfile;
-    return rv;
-}
-
-NS_IMETHODIMP nsProfile::GetProfilePath(const PRUnichar *profileName, PRUnichar **_retval)
-{
-    NS_ENSURE_ARG(profileName);
-    NS_ENSURE_ARG_POINTER(_retval);
-    *_retval = nsnull;
-    
-    nsCOMPtr<nsIFile> profileDir;
-    nsresult rv = GetProfileDir(profileName, getter_AddRefs(profileDir));
-    if (NS_FAILED(rv)) return rv;
-    
-    PRBool isSalted;    
-    nsCOMPtr<nsIFile> prettyDir(profileDir);
-    rv = IsProfileDirSalted(profileDir, &isSalted);
-    if (NS_SUCCEEDED(rv) && isSalted) {
-        nsCOMPtr<nsIFile> parentDir;
-        rv = profileDir->GetParent(getter_AddRefs(parentDir));
-        if (NS_SUCCEEDED(rv))
-            prettyDir = parentDir;
-    }
-    nsAutoString path;
-    rv = prettyDir->GetPath(path);
-    if (NS_FAILED(rv)) return rv;
-
-    *_retval = ToNewUnicode(path);
-    return *_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
-}
-
-NS_IMETHODIMP nsProfile::GetOriginalProfileDir(const PRUnichar *profileName, nsILocalFile **originalDir)
-{
-    NS_ENSURE_ARG(profileName);
-    NS_ENSURE_ARG_POINTER(originalDir);
-    *originalDir = nsnull;
-
-    Update4xProfileInfo();
-    return gProfileDataAccess->GetOriginalProfileDir(profileName, originalDir);
-}
-
-NS_IMETHODIMP nsProfile::GetProfileLastModTime(const PRUnichar *profileName, PRInt64 *_retval)
-{
-    NS_ENSURE_ARG(profileName);
-    NS_ENSURE_ARG_POINTER(_retval);
-    nsresult rv;
-    
-    // First, see if we can get the lastModTime from the registry.
-    // We only started putting it there from mozilla1.0.1
-    // The mod time will be zero if it has not been set.
-    ProfileStruct *profileInfo = nsnull;
-    rv = gProfileDataAccess->GetValue(profileName, &profileInfo);
-    if (NS_SUCCEEDED(rv)) {
-        PRInt64 lastModTime = profileInfo->lastModTime;
-        delete profileInfo;
-        if (!LL_IS_ZERO(lastModTime)) {
-            *_retval = lastModTime;
-            return NS_OK;
-        }
-    }
-
-    // Since we couldn't get a valid mod time from the registry,
-    // check the date of prefs.js. Since August, 2000 it is always
-    // written out on quitting the application.
-    nsCOMPtr<nsIFile> profileDir;
-    rv = GetProfileDir(profileName, getter_AddRefs(profileDir));
-    if (NS_FAILED(rv))
-        return rv;
-    rv = profileDir->AppendNative(NS_LITERAL_CSTRING("prefs.js"));
-    if (NS_FAILED(rv))
-        return rv;
-    return profileDir->GetLastModifiedTime(_retval);
-}
-
-NS_IMETHODIMP nsProfile::GetDefaultProfileParentDir(nsIFile **aDefaultProfileParentDir)
-{
-    NS_ENSURE_ARG_POINTER(aDefaultProfileParentDir);
-
-    nsresult rv;
-    
-    nsCOMPtr<nsIFile> aDir;
-    rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILES_ROOT_DIR, getter_AddRefs(aDir));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    *aDefaultProfileParentDir = aDir;
-    NS_ADDREF(*aDefaultProfileParentDir);
-
-    return NS_OK;
-}
-
-// Gets the number of profiles
-// Location: Common/Profiles
-NS_IMETHODIMP nsProfile::GetProfileCount(PRInt32 *numProfiles)
-{
-    NS_ENSURE_ARG_POINTER(numProfiles);
-
-    *numProfiles = 0;
-
-    gProfileDataAccess->GetNumProfiles(numProfiles);
-    return NS_OK;
-}
-
-
-// If only a single profile exists
-// return the name of the single profile.
-// Otherwise it return the name of the first valid profile.
-NS_IMETHODIMP nsProfile::GetFirstProfile(PRUnichar **profileName)
-{
-    NS_ENSURE_ARG_POINTER(profileName);
-
-    gProfileDataAccess->GetFirstProfile(profileName);
-    gProfileDataAccess->SetCurrentProfile(*profileName);
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP nsProfile::GetStartWithLastUsedProfile(PRBool *aStartWithLastUsedProfile)
-{
-    NS_ENSURE_ARG_POINTER(aStartWithLastUsedProfile);
-    return gProfileDataAccess->GetStartWithLastUsedProfile(aStartWithLastUsedProfile);
-}
-
-NS_IMETHODIMP nsProfile::SetStartWithLastUsedProfile(PRBool aStartWithLastUsedProfile)
-{
-    return gProfileDataAccess->SetStartWithLastUsedProfile(aStartWithLastUsedProfile);
-}
-
-// Returns the name of the current profile i.e., the last used profile
-NS_IMETHODIMP
-nsProfile::GetCurrentProfile(PRUnichar **profileName)
-{
-    NS_ENSURE_ARG_POINTER(profileName);
-    *profileName = nsnull;
-
-    if (!mCurrentProfileName.IsEmpty()) 
-      *profileName = ToNewUnicode(mCurrentProfileName);
-    else 
-      gProfileDataAccess->GetCurrentProfile(profileName);
-    return (*profileName == nsnull) ? NS_ERROR_FAILURE : NS_OK;
-}
-
-
-NS_IMETHODIMP
-nsProfile::SetCurrentProfile(const PRUnichar * aCurrentProfile)
-{
-    NS_ENSURE_ARG(aCurrentProfile);
-    
-    nsresult rv;
-    nsCOMPtr<nsIFile> profileDir;
-    PRBool exists;
-
-    // Ensure that the profile exists and its directory too.
-    rv = GetProfileDir(aCurrentProfile, getter_AddRefs(profileDir));
-    if (NS_FAILED(rv)) return rv;
-    rv = profileDir->Exists(&exists);
-    if (NS_FAILED(rv)) return rv;
-    if (!exists) return NS_ERROR_FILE_NOT_FOUND;
-
-    PRBool isSwitch;
-
-    if (mCurrentProfileAvailable)
-    {
-        nsXPIDLString currProfileName;
-        rv = GetCurrentProfile(getter_Copies(currProfileName));
-        if (NS_FAILED(rv)) return rv;
-        if (nsCRT::strcmp(aCurrentProfile, currProfileName.get()) == 0)
-            return NS_OK;
-        else
-            isSwitch = PR_TRUE;
-    }
-    else
-        isSwitch = PR_FALSE;
-#ifdef MOZ_PROFILELOCKING    
-    nsProfileLock localLock;
-    nsCOMPtr<nsILocalFile> localProfileDir(do_QueryInterface(profileDir, &rv));
-    if (NS_FAILED(rv)) return rv;
-    rv = localLock.Lock(localProfileDir, nsnull);
-    if (NS_FAILED(rv))
-    {
-        NS_ERROR("Could not get profile directory lock.");
-        return rv;
-    }
-#endif
-    nsCOMPtr<nsIObserverService> observerService = 
-             do_GetService("@mozilla.org/observer-service;1", &rv);
-    NS_ENSURE_TRUE(observerService, NS_ERROR_FAILURE);
-    
-    nsISupports *subject = (nsISupports *)((nsIProfile *)this);
-    NS_NAMED_LITERAL_STRING(switchString, "switch");
-    NS_NAMED_LITERAL_STRING(startupString, "startup");
-    const nsAFlatString& context = isSwitch ? switchString : startupString;
-    
-    if (isSwitch)
-    {
-        // Phase 1: See if anybody objects to the profile being changed.
-        mProfileChangeVetoed = PR_FALSE;        
-        observerService->NotifyObservers(subject, "profile-approve-change", context.get());
-        if (mProfileChangeVetoed)
-            return NS_OK;
-
-        // Phase 2a: Send the network teardown notification
-        observerService->NotifyObservers(subject, "profile-change-net-teardown", context.get());
-        mShutdownProfileToreDownNetwork = PR_TRUE;
-
-        // Phase 2b: Send the "teardown" notification
-        observerService->NotifyObservers(subject, "profile-change-teardown", context.get());
-        if (mProfileChangeVetoed)
-        {
-            // Notify we will not proceed with changing the profile
-            observerService->NotifyObservers(subject, "profile-change-teardown-veto", context.get());
-
-            // Bring network back online and return
-            observerService->NotifyObservers(subject, "profile-change-net-restore", context.get());
-            return NS_OK;
-        }
-        
-        // Phase 2c: Now that things are torn down, force JS GC so that things which depend on
-        // resources which are about to go away in "profile-before-change" are destroyed first.
-        nsCOMPtr<nsIThreadJSContextStack> stack =
-          do_GetService("@mozilla.org/js/xpc/ContextStack;1", &rv);
-        if (NS_SUCCEEDED(rv))
-        {
-          JSContext *cx = nsnull;
-          stack->GetSafeJSContext(&cx);
-          if (cx)
-            ::JS_GC(cx);
-        }
-        
-        // Phase 3: Notify observers of a profile change
-        observerService->NotifyObservers(subject, "profile-before-change", context.get());        
-        if (mProfileChangeFailed)
-          return NS_ERROR_ABORT;
-        
-        UpdateCurrentProfileModTime(PR_FALSE);        
-    }
-
-#ifdef MOZ_PROFILELOCKING    
-    // Do the profile switch
-    localLock.Unlock(); // gDirServiceProvider will get and hold its own lock
-#endif
-    nsCOMPtr<nsIFile> localDir;
-    GetLocalProfileDir(aCurrentProfile, getter_AddRefs(localDir));
-    gDirServiceProvider->SetProfileDir(profileDir, localDir);
-    mCurrentProfileName.Assign(aCurrentProfile);    
-    gProfileDataAccess->SetCurrentProfile(aCurrentProfile);
-    gProfileDataAccess->mProfileDataChanged = PR_TRUE;
-    gProfileDataAccess->UpdateRegistry(nsnull);
-            
-    if (NS_FAILED(rv)) return rv;
-    mCurrentProfileAvailable = PR_TRUE;
-    
-    if (!isSwitch)
-    {
-        // Ensure that the prefs service exists so it can respond to
-        // the notifications we're about to send around. It needs to.
-        nsCOMPtr<nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
-        NS_ASSERTION(NS_SUCCEEDED(rv), "Could not get prefs service");
-    }
-
-    if (mShutdownProfileToreDownNetwork)
-    {
-        // Bring network back online
-        observerService->NotifyObservers(subject, "profile-change-net-restore", context.get());
-        mShutdownProfileToreDownNetwork = PR_FALSE;
-        if (mProfileChangeFailed)
-          return NS_ERROR_ABORT;
-    }
-
-    // Roaming download
-    // Tolerate errors. Maybe the roaming extension isn't installed.
-    nsCOMPtr <nsISessionRoaming> roam =
-      do_GetService(NS_SESSIONROAMING_CONTRACTID, &rv);
-    if (NS_SUCCEEDED(rv))
-      roam->BeginSession();
-
-    // Phase 4: Notify observers that the profile has changed - Here they respond to new profile
-    observerService->NotifyObservers(subject, "profile-do-change", context.get());
-    if (mProfileChangeFailed)
-      return NS_ERROR_ABORT;
-
-    // Phase 5: Now observers can respond to something another observer did in phase 4
-    observerService->NotifyObservers(subject, "profile-after-change", context.get());
-    if (mProfileChangeFailed)
-      return NS_ERROR_ABORT;
-
-    // Now that a profile is established, set the profile defaults dir for the locale of this profile
-    rv = DefineLocaleDefaultsDir();
-    NS_ASSERTION(NS_SUCCEEDED(rv), "nsProfile::DefineLocaleDefaultsDir failed");
-
-    // Phase 6: One last notification after the new profile is established
-    observerService->NotifyObservers(subject, "profile-initial-state", context.get());
-    if (mProfileChangeFailed)
-      return NS_ERROR_ABORT;
-
-    nsCOMPtr<nsICategoryManager> catman =
-             do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
-
-    if(NS_SUCCEEDED(rv) && catman)
-    {
-        nsCOMPtr<nsISimpleEnumerator> enumItem;
-        rv = catman->EnumerateCategory(NS_PROFILE_STARTUP_CATEGORY, getter_AddRefs(enumItem));
-        if(NS_SUCCEEDED(rv) && enumItem)
-        {
-           while (PR_TRUE)
-           {
-               nsCOMPtr<nsISupportsCString> contractid;
-
-               rv = enumItem->GetNext(getter_AddRefs(contractid));
-               if (NS_FAILED(rv) || !contractid) break;
-
-               nsCAutoString contractidString;
-               contractid->GetData(contractidString);
-        
-               nsCOMPtr <nsIProfileStartupListener> listener = do_GetService(contractidString.get(), &rv);
-        
-               if (listener)
-                   listener->OnProfileStartup(aCurrentProfile);
-           }
-        }
-    }
-
-    nsCOMPtr<nsIPrefBranch> prefBranch;
-  
-    nsCOMPtr<nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
-    if (NS_FAILED(rv)) return rv;
-    rv = prefs->GetBranch(nsnull, getter_AddRefs(prefBranch));
-    if (NS_FAILED(rv)) return rv;
-
-    PRBool prefs_converted = PR_FALSE;
-    (void)prefBranch->GetBoolPref("prefs.converted-to-utf8", &prefs_converted);
-
-    if (!prefs_converted)
-    {
-        nsCOMPtr <nsIPrefConverter> pPrefConverter = do_GetService(kPrefConverterCID, &rv);
-        if (!pPrefConverter) return NS_ERROR_FAILURE;
-        rv = pPrefConverter->ConvertPrefsToUTF8();
-        if (NS_FAILED(rv)) return rv;
-    }
-    
-    return NS_OK;
-}
-
-
-// Returns the name of the current profile directory
-NS_IMETHODIMP nsProfile::GetCurrentProfileDir(nsIFile **profileDir)
-{
-    NS_ENSURE_ARG_POINTER(profileDir);
-    nsresult rv;
-
-    nsXPIDLString profileName;
-    rv = GetCurrentProfile(getter_Copies(profileName));
-    if (NS_FAILED(rv)) return rv;
-
-    rv = GetProfileDir(profileName, profileDir);
-    if (NS_FAILED(rv)) return rv;
-
-    return NS_OK;
-}
-
-// Performs a "logout" by shutting down the current profile
-NS_IMETHODIMP nsProfile::ShutDownCurrentProfile(PRUint32 shutDownType)
-{
-    nsresult rv;
-    
-    // if shutDownType is not a well know value, skip the notifications
-    // see DoOnShutdown() in nsAppRunner.cpp for where we use this behaviour to our benefit
-    if (shutDownType == SHUTDOWN_PERSIST || shutDownType == SHUTDOWN_CLEANSE) {
-      nsCOMPtr<nsIObserverService> observerService = 
-        do_GetService("@mozilla.org/observer-service;1", &rv);
-      NS_ENSURE_TRUE(observerService, NS_ERROR_FAILURE);
-      
-      nsISupports *subject = (nsISupports *)((nsIProfile *)this);
-      
-      NS_NAMED_LITERAL_STRING(cleanseString, "shutdown-cleanse");
-      NS_NAMED_LITERAL_STRING(persistString, "shutdown-persist");
-      const nsAFlatString& context = (shutDownType == SHUTDOWN_CLEANSE) ? cleanseString : persistString;
-      
-      // Phase 1: See if anybody objects to the profile being changed.
-      mProfileChangeVetoed = PR_FALSE;        
-      observerService->NotifyObservers(subject, "profile-approve-change", context.get());
-      if (mProfileChangeVetoed)
-        return NS_OK;
-      
-      // Phase 2a: Send the network teardown notification
-      observerService->NotifyObservers(subject, "profile-change-net-teardown", context.get());
-      mShutdownProfileToreDownNetwork = PR_TRUE;
-
-      // Phase 2b: Send the "teardown" notification
-      observerService->NotifyObservers(subject, "profile-change-teardown", context.get());
-
-      // Phase 2c: Now that things are torn down, force JS GC so that things which depend on
-      // resources which are about to go away in "profile-before-change" are destroyed first.
-      nsCOMPtr<nsIThreadJSContextStack> stack =
-        do_GetService("@mozilla.org/js/xpc/ContextStack;1", &rv);
-      if (NS_SUCCEEDED(rv))
-      {
-        JSContext *cx = nsnull;
-        stack->GetSafeJSContext(&cx);
-        if (cx)
-          ::JS_GC(cx);
-      }
-      
-      // Phase 3: Notify observers of a profile change
-      observerService->NotifyObservers(subject, "profile-before-change", context.get());        
-    }
-
-    // Roaming upload
-    // Tolerate errors. Maybe the roaming extension isn't installed.
-    nsCOMPtr <nsISessionRoaming> roam =
-      do_GetService(NS_SESSIONROAMING_CONTRACTID, &rv);
-    if (NS_SUCCEEDED(rv))
-      roam->EndSession();
-
-    gDirServiceProvider->SetProfileDir(nsnull);
-    UpdateCurrentProfileModTime(PR_TRUE);
-    mCurrentProfileAvailable = PR_FALSE;
-    mCurrentProfileName.Truncate(0);
-    
-    return NS_OK;
-}
-
-
-#define SALT_SIZE 8
-#define TABLE_SIZE 36
-
-static const char kSaltExtensionCString[] = ".slt";
-#define kSaltExtensionCString_Len PRUint32(sizeof(kSaltExtensionCString)-1)
-
-static const char table[] = 
-	{ 'a','b','c','d','e','f','g','h','i','j',
-	  'k','l','m','n','o','p','q','r','s','t',
-	  'u','v','w','x','y','z','0','1','2','3',
-	  '4','5','6','7','8','9'};
-
-// for security, add a level of indirection:
-// an extra directory with a hard to guess name.
-
-nsresult
-nsProfile::AddLevelOfIndirection(nsIFile *aDir)
-{
-  nsresult rv;
-  PRBool exists = PR_FALSE;
-  if (!aDir) return NS_ERROR_NULL_POINTER;
-
-  // check if aDir/prefs.js exists, if so, use it.
-  // else, check if aDir/*.slt exists, if so, use it.
-  // else, do the salt
-  nsCOMPtr<nsIFile> prefFile;
-  rv = aDir->Clone(getter_AddRefs(prefFile));
-  NS_ENSURE_SUCCESS(rv,rv);
-
-  rv = prefFile->AppendNative(NS_LITERAL_CSTRING("prefs.js"));
-  NS_ENSURE_SUCCESS(rv,rv);
-
-  rv = prefFile->Exists(&exists);
-  NS_ENSURE_SUCCESS(rv,rv);
-
-  if (exists) {
-	// there is a prefs.js file in aDir, so just use aDir and don't salt
-	return NS_OK;
-  }
-
-  // no prefs.js, now search for a .slt directory
-  PRBool hasMore = PR_FALSE;
-  PRBool isDir = PR_FALSE;
-  nsCOMPtr<nsISimpleEnumerator> dirIterator;
-  rv = aDir->GetDirectoryEntries(getter_AddRefs(dirIterator));
-  NS_ENSURE_SUCCESS(rv,rv);
-
-  rv = dirIterator->HasMoreElements(&hasMore);
-  NS_ENSURE_SUCCESS(rv,rv);
-
-  nsCOMPtr<nsIFile> dirEntry;
-
-  while (hasMore) {
-    rv = dirIterator->GetNext((nsISupports**)getter_AddRefs(dirEntry));
-    if (NS_SUCCEEDED(rv)) {
-      rv = dirEntry->IsDirectory(&isDir);
-      if (NS_SUCCEEDED(rv) && isDir) {
-        nsCAutoString leafName;
-        rv = dirEntry->GetNativeLeafName(leafName);
-	 	if (NS_SUCCEEDED(rv) && !leafName.IsEmpty()) {
-		  PRUint32 length = leafName.Length();
-		  // check if the filename is the right length, len("xxxxxxxx.slt")
-		  if (length == (SALT_SIZE + kSaltExtensionCString_Len)) {
-			// check that the filename ends with ".slt"
-			if (nsCRT::strncmp(leafName.get() + SALT_SIZE,
-                         kSaltExtensionCString,
-                         kSaltExtensionCString_Len) == 0) {
-			  // found a salt directory, use it
-			  rv = aDir->AppendNative(leafName);
-			  return rv;
-			}
-		  }
-		}
-      }
-    }
-    rv = dirIterator->HasMoreElements(&hasMore);
-    NS_ENSURE_SUCCESS(rv,rv);
-  }
-  
-  // if we get here, we need to add the extra directory
-
-  // turn PR_Now() into milliseconds since epoch
-  // and salt rand with that.
-  double fpTime;
-  LL_L2D(fpTime, PR_Now());
-  srand((uint)(fpTime * 1e-6 + 0.5));	// use 1e-6, granularity of PR_Now() on the mac is seconds
-
-  nsCAutoString saltStr;
-  PRInt32 i;
-  for (i=0;i<SALT_SIZE;i++) {
-  	saltStr.Append(table[rand()%TABLE_SIZE]);
-  }
-  saltStr.Append(kSaltExtensionCString, kSaltExtensionCString_Len);
-#ifdef DEBUG_profile_verbose
-  printf("directory name: %s\n",saltStr.get());
-#endif
-
-  rv = aDir->AppendNative(saltStr);
-  NS_ENSURE_SUCCESS(rv,rv);
-
-  exists = PR_FALSE;
-  rv = aDir->Exists(&exists);
-  NS_ENSURE_SUCCESS(rv,rv);
-  if (!exists) {
-    rv = aDir->Create(nsIFile::DIRECTORY_TYPE, 0700);
-    NS_ENSURE_SUCCESS(rv,rv);
-  }
-	
-  return NS_OK;
-}
-
-nsresult nsProfile::IsProfileDirSalted(nsIFile *profileDir, PRBool *isSalted)
-{
-    nsresult rv;
-    NS_ENSURE_ARG_POINTER(isSalted);
-    *isSalted = PR_FALSE;
-    
-    // 1. The name of the profile dir has to end in ".slt"
-    nsCAutoString leafName;
-    rv = profileDir->GetNativeLeafName(leafName);
-    if (NS_FAILED(rv)) return rv;
-
-    PRBool endsWithSalt = PR_FALSE;    
-    if (leafName.Length() >= kSaltExtensionCString_Len)
-    {
-        nsReadingIterator<char> stringEnd;
-        leafName.EndReading(stringEnd);
-
-        nsReadingIterator<char> stringStart = stringEnd;
-        stringStart.advance( -(static_cast<PRInt32>(kSaltExtensionCString_Len)) );
-
-        endsWithSalt =
-            Substring(stringStart, stringEnd).Equals(kSaltExtensionCString);
-    }
-    if (!endsWithSalt)
-        return NS_OK;
-    
-    // 2. The profile dir has to be its parent's only child.    
-    nsCOMPtr<nsIFile> parentDir;
-    rv = profileDir->GetParent(getter_AddRefs(parentDir));
-    if (NS_FAILED(rv)) return rv;
-
-    PRBool hasMore;
-    nsCOMPtr<nsISimpleEnumerator> dirIterator;
-    rv = parentDir->GetDirectoryEntries(getter_AddRefs(dirIterator));
-    if (NS_FAILED(rv)) return rv;
-    
-    PRInt32 numChildren = 0;
-    rv = dirIterator->HasMoreElements(&hasMore);
-    
-    while (NS_SUCCEEDED(rv) && hasMore && numChildren <= 1) {
-        nsCOMPtr<nsIFile> child;
-        rv = dirIterator->GetNext((nsISupports**)getter_AddRefs(child));    
-        if (NS_SUCCEEDED(rv))
-            ++numChildren;
-        rv = dirIterator->HasMoreElements(&hasMore);
-    }
-    if (NS_SUCCEEDED(rv) && numChildren == 1)
-        *isSalted = PR_TRUE;
-    
-    return NS_OK;
-}
-
-/*
- * Setters
- */
-
-// Sets the current profile directory
-nsresult nsProfile::SetProfileDir(const PRUnichar *profileName, nsIFile *profileDir)
-{
-    NS_ENSURE_ARG(profileName);
-    NS_ENSURE_ARG(profileDir);   
-
-    nsresult rv = NS_OK;
- 
-    // Need to ensure that this directory exists
-    PRBool exists;
-    rv = profileDir->Exists(&exists);
-    if (NS_SUCCEEDED(rv) && !exists)
-        rv = profileDir->Create(nsIFile::DIRECTORY_TYPE, 0700);
-    if (NS_FAILED(rv)) 
-        return rv;
-    
-    nsCOMPtr<nsILocalFile> localFile(do_QueryInterface(profileDir));
-    NS_ENSURE_TRUE(localFile, NS_ERROR_FAILURE);                
-
-    ProfileStruct* aProfile = new ProfileStruct();
-    NS_ENSURE_TRUE(aProfile, NS_ERROR_OUT_OF_MEMORY);
-
-    aProfile->profileName = profileName;
-    aProfile->SetResolvedProfileDir(localFile);
-    aProfile->isMigrated = PR_TRUE;
-    aProfile->isImportType = PR_FALSE;
-
-    // convert "now" from microsecs to millisecs
-    PRInt64 oneThousand = LL_INIT(0, 1000);
-    PRInt64 nowInMilliSecs = PR_Now();
-    LL_DIV(aProfile->creationTime, nowInMilliSecs, oneThousand); 
-
-    gProfileDataAccess->SetValue(aProfile);
-    
-    delete aProfile;
-
-    return rv;
-}
-
-// Creates a new profile with UILocale and contentLocale
-NS_IMETHODIMP 
-nsProfile::CreateNewProfileWithLocales(const PRUnichar* profileName, 
-                            const PRUnichar* nativeProfileDir,
-                            const PRUnichar* aUILocale,
-                            const PRUnichar* aContentLocale,
-                            PRBool useExistingDir)
-{
-    NS_ENSURE_ARG_POINTER(profileName);   
-
-    nsresult rv = NS_OK;
-
-#if defined(DEBUG_profile)
-    {
-      printf("ProfileManager : CreateNewProfileWithLocales\n");
-
-      printf("Profile Name: %s\n", NS_LossyConvertUTF16toASCII(profileName).get());
-
-      if (nativeProfileDir)
-        printf("Profile Dir: %s\n", NS_LossyConvertUTF16toASCII(nativeProfileDir).get());
-    }
-#endif
-
-    nsCOMPtr<nsIFile> profileDir;
-    PRBool exists;
-    
-    if (!nativeProfileDir)
-    {
-        // They didn't specify a directory path...
-                
-        rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILES_ROOT_DIR, getter_AddRefs(profileDir));
-        if (NS_FAILED(rv)) return rv;
-        rv = profileDir->Exists(&exists);
-        if (NS_FAILED(rv)) return rv;        
-        if (!exists)
-            profileDir->Create(nsIFile::DIRECTORY_TYPE, 0700);
-
-        // append profile name
-        profileDir->Append(nsDependentString(profileName));
-    }
-    else {
-    
-        rv = NS_NewLocalFile(nsDependentString(nativeProfileDir), PR_TRUE, (nsILocalFile **)((nsIFile **)getter_AddRefs(profileDir)));
-        if (NS_FAILED(rv)) return rv;
-
-        // this prevents people from choosing their profile directory
-        // or another directory, and remove it when they delete the profile.
-        // append profile name
-        profileDir->Append(nsDependentString(profileName));
-    }
-
-
-    // Make profile directory unique only when the user 
-    // decides to not use an already existing profile directory
-    if (!useExistingDir) {
-        rv = profileDir->CreateUnique(nsIFile::DIRECTORY_TYPE, 0700);
-        if (NS_FAILED(rv)) return rv;
-    }
-
-#if defined(DEBUG_profile_verbose)
-    printf("before SetProfileDir\n");
-#endif
-
-    rv = profileDir->Exists(&exists);
-    if (NS_FAILED(rv)) return rv;        
-    if (!exists)
-    {
-        rv = profileDir->Create(nsIFile::DIRECTORY_TYPE, 0700);
-        if (NS_FAILED(rv)) return rv;
-        useExistingDir = PR_FALSE;
-    }
-
-    // since the directory didn't exist, add the indirection
-    rv = AddLevelOfIndirection(profileDir);
-    if (NS_FAILED(rv)) return rv;
-
-    // Set the directory value and add the entry to the registry tree.
-    rv = SetProfileDir(profileName, profileDir);
-
-#if defined(DEBUG_profile_verbose)
-    printf("after SetProfileDir\n");
-#endif
-
-    // Get profile defaults folder..
-    nsCOMPtr <nsIFile> profDefaultsDir;
-    rv = NS_GetSpecialDirectory(NS_APP_PROFILE_DEFAULTS_NLOC_50_DIR, getter_AddRefs(profDefaultsDir));
-    if (NS_FAILED(rv)) return rv;
-
-    nsCOMPtr<nsIChromeRegistrySea> chromeRegistry =
-        do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &rv);
-    if (NS_SUCCEEDED(rv)) {
-
-        nsCAutoString uiLocale, contentLocale;
-        LossyCopyUTF16toASCII(aUILocale, uiLocale);
-        LossyCopyUTF16toASCII(aContentLocale, contentLocale);
-
-        // When aUILocale == null or aContentLocale == null, set those
-        // from default values which are from default or from command
-        // line options
-
-        // This fallback is for CreateNewProfile() of
-        // CreateDefaultProfile() and ProcessArgs() Those functions
-        // call CreateNewProfile(locale=null). We should consider
-        // default values or specified values of locales for
-        // CreateDefaultProfile() and ProcessArgs().
-
-        // We can get preferred UILocale and contentLocale (specified
-        // -UILocale and -contentLocale) by GetSelectedLocale() which
-        // is done in nsAppRunner.cpp::InstallGlobalLocale()
-
-        nsCOMPtr<nsIChromeRegistrySea> packageRegistry = do_QueryInterface(chromeRegistry);
-        if (uiLocale.IsEmpty() && packageRegistry) {
-            nsCAutoString currentUILocaleName;
-            rv = packageRegistry->GetSelectedLocale(NS_LITERAL_CSTRING("global"),
-                                                    currentUILocaleName);
-            if (NS_SUCCEEDED(rv)) {
-                uiLocale = currentUILocaleName;
-            }
-        }
-
-        if (contentLocale.IsEmpty()) {
-            nsCAutoString currentContentLocaleName;
-            rv = packageRegistry->GetSelectedLocale(NS_LITERAL_CSTRING("global-region"),
-                                                    currentContentLocaleName);
-            if (NS_SUCCEEDED(rv)) {
-                contentLocale = currentContentLocaleName;
-            }
-        }
-
-#if defined(DEBUG_profile_verbose)
-        printf(" uiLocale=%s\n", uiLocale.get());
-        printf(" contentLocale=%s\n", contentLocale.get());
-#endif
-
-        nsCAutoString pathBuf;
-        rv = profileDir->GetNativePath(pathBuf);
-        NS_ENSURE_SUCCESS(rv, rv);
-
-        nsCAutoString fileStr;
-        rv = NS_GetURLSpecFromFile(profileDir, fileStr);
-        if (NS_FAILED(rv)) return rv;
-
-        if (!uiLocale.IsEmpty()) {
-            rv = chromeRegistry->SelectLocaleForProfile(uiLocale, 
-                                                        NS_ConvertUTF8toUTF16(fileStr).get());
-            // Remember which profile has been created with the UILocale
-            // didn't use gProfileDataAccess because just needed one time
-            if (NS_SUCCEEDED(rv)) {
-                nsCStringKey key(pathBuf);
-                gLocaleProfiles->Put(&key, (void*)PR_TRUE);
-            }
-        }
-
-        //need to set skin info here
-        nsCAutoString currentSkinName;
-        rv = packageRegistry->GetSelectedSkin(NS_LITERAL_CSTRING("global"),currentSkinName);
-        if (!currentSkinName.IsEmpty()) {
-            rv = chromeRegistry->SelectSkinForProfile(currentSkinName,
-                                         NS_ConvertUTF8toUTF16(fileStr).get());
-        }
-
-        if (!contentLocale.IsEmpty()) {
-            // caller prefers locale subdir
-            nsCOMPtr<nsIFile> locProfDefaultsDir;
-            rv = profDefaultsDir->Clone(getter_AddRefs(locProfDefaultsDir));
-            if (NS_FAILED(rv)) return rv;
-        
-            locProfDefaultsDir->AppendNative(contentLocale);
-            rv = locProfDefaultsDir->Exists(&exists);
-            if (NS_SUCCEEDED(rv) && exists) {
-                profDefaultsDir = locProfDefaultsDir; // transfers ownership
-#if defined(DEBUG_profile_verbose)
-                nsCAutoString profilePath;
-                rv = profDefaultsDir->GetNativePath(profilePath);
-                if (NS_SUCCEEDED(rv))
-                    printf(" profDefaultsDir is set to: %s\n", profilePath.get());
-#endif
-            }
-
-            rv = chromeRegistry->SelectLocaleForProfile(contentLocale, 
-                                                        NS_ConvertUTF8toUTF16(fileStr).get());
-            // Remember which profile has been created with the UILocale
-            // didn't use gProfileDataAccess because just needed one time
-            if (NS_SUCCEEDED(rv)) {
-                nsCStringKey key(pathBuf);
-                gLocaleProfiles->Put(&key, (void*)PR_TRUE);
-            }
-        }
-    }
-
-    // Copy contents from defaults folder.
-    rv = profDefaultsDir->Exists(&exists);
-    if (NS_SUCCEEDED(rv) && exists && (!useExistingDir))
-    {
-        RecursiveCopy(profDefaultsDir, profileDir);
-    }
-
-    gProfileDataAccess->mProfileDataChanged = PR_TRUE;
-    gProfileDataAccess->UpdateRegistry(nsnull);
-    
-    return NS_OK;
-}	
-
-
-// Rename a old profile to new profile.
-// Copies all the keys from old profile to new profile.
-
-// Creates a new profile
-NS_IMETHODIMP 
-nsProfile::CreateNewProfile(const PRUnichar* profileName, 
-                            const PRUnichar* nativeProfileDir,
-                            const PRUnichar* langcode,
-                            PRBool useExistingDir)
-{
-    return CreateNewProfileWithLocales(profileName,nativeProfileDir,langcode,nsnull,useExistingDir);
-}
-
-
-// Rename a old profile to new profile.
-// Copies all the keys from old profile to new profile.
-// Deletes the old profile from the registry
-NS_IMETHODIMP 
-nsProfile::RenameProfile(const PRUnichar* oldName, const PRUnichar* newName)
-{
-    NS_ENSURE_ARG_POINTER(oldName);   
-    NS_ENSURE_ARG_POINTER(newName);   
-
-    nsresult rv = NS_OK;
-
-#if defined(DEBUG_profile)
-    {
-      printf("ProfileManager : Renaming profile\n");
-
-      nsCAutoString temp1; temp1.AssignWithConversion(oldName);
-      printf("Old name:  %s\n", NS_LossyConvertUTF16toASCII(oldName).get());
-
-      nsCAutoString temp2; temp2.AssignWithConversion(newName);
-      printf("New name:  %s\n", NS_LossyConvertUTF16toASCII(newName).get());
-    }
-#endif
-
-    PRBool exists;
-    rv = ProfileExists(newName, &exists);
-    if (NS_FAILED(rv)) return rv;
-    
-    // That profile already exists...
-    if (exists) {
-#if defined(DEBUG_profile)  
-        printf("ProfileManager : Rename Operation failed : Profile exists. Provide a different new name for profile.\n");
-#endif
-        return NS_ERROR_FAILURE;
-    }
-
-    PRBool renamedIsCurrent = mCurrentProfileName.Equals(oldName);
-
-    // Copy reg keys
-    rv = CopyRegKey(oldName, newName);
-    if (NS_FAILED(rv)) return rv;
-     
-    // Delete old profile entry
-    rv = DeleteProfile(oldName, PR_FALSE /* don't delete files */);
-
-    // If the profile being renamed is the current profile,
-    // change the current profile name.
-    if (renamedIsCurrent) {
-        gProfileDataAccess->SetCurrentProfile(newName);
-        gProfileDataAccess->mForgetProfileCalled = PR_FALSE;
-        mCurrentProfileName.Assign(newName);    
-        mCurrentProfileAvailable = PR_TRUE;
-    }
-
-    if (NS_FAILED(rv)) return rv;
-     
-	/* note, we do not rename the directory on disk to the new name
-	 * this is on purpose.
-     *
-	 * we don't require the directory name to match the profile name, 
-	 * but it usually does.  
-	 * (the pairing of values occurs in the profile registry)
-	 * 
-	 * Imagine this scenario:
-	 * 1) user creates a profile "foo" and the directory gets named "foo".
- 	 * 2) user creates a profile "bar" and the directory gets named "bar"
-	 * 3) user deletes the profile "foo", but chooses not to delete the files on disk.  (they are given this option when deleting a profile)
-	 * 4) user renames "bar" profile to "foo", but still uses the directory named "bar" on disk
-	 *
-	 * bad things would happen if we tried to rename the directory
-	 */
-
-    gProfileDataAccess->mProfileDataChanged = PR_TRUE;
-    gProfileDataAccess->UpdateRegistry(nsnull);
-
-    return NS_OK;
-}
-
-// Copy old profile entries to the new profile
-// In the process creates new profile subtree.
-nsresult nsProfile::CopyRegKey(const PRUnichar *oldProfile, const PRUnichar *newProfile)
-{
-    NS_ENSURE_ARG_POINTER(oldProfile);   
-    NS_ENSURE_ARG_POINTER(newProfile);   
-
-    nsresult rv = NS_OK;
-
-    ProfileStruct    *aProfile;
-
-    rv = gProfileDataAccess->GetValue(oldProfile, &aProfile);
-    if (NS_FAILED(rv)) return rv;
-
-    aProfile->profileName        = newProfile;
-
-    rv = gProfileDataAccess->SetValue(aProfile);
-
-	delete aProfile;
-
-    return rv;
-}
-
-NS_IMETHODIMP nsProfile::ForgetCurrentProfile()
-{
-    nsresult rv = NS_OK;
-
-    // Remove the current profile subtree from the registry.
-    PRUnichar tmp[] = { '\0' };
-
-    gProfileDataAccess->SetCurrentProfile(tmp);
-    if (NS_FAILED(rv)) return rv;  
-
-    gProfileDataAccess->mForgetProfileCalled = PR_TRUE;
-    mCurrentProfileAvailable = PR_FALSE;
-    mCurrentProfileName.Truncate(0);
-    
-    return rv;
-}
-
-// Delete a profile from the registry
-// Not deleting the directories on the harddisk yet.
-// 4.x kind of confirmation need to be implemented yet
-NS_IMETHODIMP nsProfile::DeleteProfile(const PRUnichar* profileName, PRBool canDeleteFiles)
-{
-    NS_ENSURE_ARG_POINTER(profileName);   
-
-    nsresult rv;
- 
-    nsXPIDLString currProfile;
-    rv = GetCurrentProfile(getter_Copies(currProfile));
-    if (NS_SUCCEEDED(rv) && !nsCRT::strcmp(profileName, currProfile)) {
-        rv = ForgetCurrentProfile();
-        if (NS_FAILED(rv)) return rv;
-    }
-    rv = NS_OK;
-    
-    // If user asks for it, delete profile directory
-    if (canDeleteFiles) {
-    
-        nsCOMPtr<nsIFile> profileDir;
-        rv = GetProfileDir(profileName, getter_AddRefs(profileDir));
-        if (NS_FAILED(rv)) return rv;
-        
-        PRBool exists;
-        rv = profileDir->Exists(&exists);
-        if (NS_FAILED(rv)) return rv;
-        
-        if (exists) {
-
-            // The profile dir may be located inside a salted dir.
-            // If so, according to IsProfileDirSalted,
-            // delete the parent dir as well.
-            
-            nsCOMPtr<nsIFile> dirToDelete(profileDir);
-            PRBool isSalted;
-            rv = IsProfileDirSalted(profileDir, &isSalted);
-            if (NS_SUCCEEDED(rv) && isSalted) {
-                nsCOMPtr<nsIFile> parentDir;
-                rv = profileDir->GetParent(getter_AddRefs(parentDir));
-                if (NS_SUCCEEDED(rv))
-                    dirToDelete = parentDir;
-            }
-            rv = dirToDelete->Remove(PR_TRUE);
-        }
-    }
-
-    // Remove the subtree from the registry.
-    gProfileDataAccess->RemoveSubTree(profileName);
-    if (NS_FAILED(rv)) return rv;
-
-    gProfileDataAccess->mProfileDataChanged = PR_TRUE;
-    gProfileDataAccess->UpdateRegistry(nsnull);
-
-    return rv;
-}
-
-
-NS_IMETHODIMP nsProfile::GetProfileList(PRUint32 *length, PRUnichar ***profileNames)
-{
-    NS_ENSURE_ARG_POINTER(length);
-    *length = 0;
-    NS_ENSURE_ARG_POINTER(profileNames);
-    *profileNames = nsnull;
-    
-    return gProfileDataAccess->GetProfileList(nsIProfileInternal::LIST_ONLY_NEW, length, profileNames);
-}
- 
-
-NS_IMETHODIMP nsProfile::GetProfileListX(PRUint32 whichKind, PRUint32 *length, PRUnichar ***profileNames)
-{
-    NS_ENSURE_ARG_POINTER(length);
-    *length = 0;
-    NS_ENSURE_ARG_POINTER(profileNames);
-    *profileNames = nsnull;
-    
-    if (whichKind == nsIProfileInternal::LIST_FOR_IMPORT)
-        Update4xProfileInfo();
-    return gProfileDataAccess->GetProfileList(whichKind, length, profileNames);
-}
-
-// this will add all the 4x profiles (with isImportType flag set) to the 
-// profiles list. The adding of profiles is done only once per session.
-nsresult nsProfile::Update4xProfileInfo()
-{
-    nsresult rv = NS_OK;
-
-#ifndef XP_BEOS
-    nsCOMPtr<nsIFile> oldRegFile;
-    rv = GetOldRegLocation(getter_AddRefs(oldRegFile));
-    if (NS_SUCCEEDED(rv))
-    rv = gProfileDataAccess->Get4xProfileInfo(oldRegFile, PR_TRUE);
-#endif
-
-    return rv;
-}
-
-nsresult nsProfile::LoadNewProfilePrefs()
-{
-    nsresult rv;
-    nsCOMPtr<nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
-    if (NS_FAILED(rv)) return rv;
-    
-    prefs->ResetUserPrefs();
-    prefs->ReadUserPrefs(nsnull);
-
-    return NS_OK;
-}
-
-nsresult nsProfile::GetOldRegLocation(nsIFile **aOldRegFile)
-{
-    NS_ENSURE_ARG_POINTER(aOldRegFile);
-    *aOldRegFile = nsnull;
-    nsresult rv = NS_OK;
-    
-    // For XP_UNIX there was no registry for 4.x profiles.
-    // Return nsnull for the file, and NS_OK - we succeeded in doing nothing.
-    
-#if defined(XP_WIN) || defined(XP_OS2) || defined(XP_MAC) || defined(XP_MACOSX)
-    nsCOMPtr<nsIFile> oldRegFile;
-
-#if defined(XP_WIN)
-    rv = NS_GetSpecialDirectory(NS_WIN_WINDOWS_DIR, getter_AddRefs(oldRegFile));
-#elif defined(XP_OS2)
-    rv = NS_GetSpecialDirectory(NS_OS2_DIR, getter_AddRefs(oldRegFile));
-#elif defined(XP_MAC) || defined(XP_MACOSX)
-    rv = NS_GetSpecialDirectory(NS_MAC_PREFS_DIR, getter_AddRefs(oldRegFile));
-#endif
-
-    if (NS_FAILED(rv))
-        return rv;
-    rv = oldRegFile->AppendNative(nsDependentCString(OLD_REGISTRY_FILE_NAME));
-    if (NS_FAILED(rv))
-        return rv;
-    NS_ADDREF(*aOldRegFile = oldRegFile);
-#endif
-
-    return rv;
-}
-
-nsresult nsProfile::UpdateCurrentProfileModTime(PRBool updateRegistry)
-{
-    nsresult rv;
-
-    // convert "now" from microsecs to millisecs
-    PRInt64 oneThousand = LL_INIT(0, 1000);
-    PRInt64 nowInMilliSecs = PR_Now();
-    LL_DIV(nowInMilliSecs, nowInMilliSecs, oneThousand); 
-    
-    rv = gProfileDataAccess->SetProfileLastModTime(mCurrentProfileName.get(), nowInMilliSecs);
-    if (NS_SUCCEEDED(rv) && updateRegistry) {
-        gProfileDataAccess->mProfileDataChanged = PR_TRUE;
-        gProfileDataAccess->UpdateRegistry(nsnull);
-    }
-    return rv;
-}
-
-// Migrate profile information from the 4x registry to 5x registry.
-NS_IMETHODIMP nsProfile::MigrateProfileInfo()
-{
-    nsresult rv = NS_OK;
-
-#ifndef XP_BEOS
-    nsCOMPtr<nsIFile> oldRegFile;
-    rv = GetOldRegLocation(getter_AddRefs(oldRegFile));
-    if (NS_SUCCEEDED(rv)) {
-    rv = gProfileDataAccess->Get4xProfileInfo(oldRegFile, PR_FALSE);
-    gProfileDataAccess->mProfileDataChanged = PR_TRUE;
-    gProfileDataAccess->UpdateRegistry(nsnull);
-    }
-#endif
-
-	return rv;
-}
-
-nsresult
-nsProfile::CopyDefaultFile(nsIFile *profDefaultsDir, nsIFile *newProfDir, const nsACString &fileName)
-{
-    nsresult rv;
-    nsCOMPtr<nsIFile> defaultFile;
-    PRBool exists;
-    
-    rv = profDefaultsDir->Clone(getter_AddRefs(defaultFile));
-    if (NS_FAILED(rv)) return rv;
-    
-    defaultFile->AppendNative(fileName);
-    rv = defaultFile->Exists(&exists);
-    if (NS_FAILED(rv)) return rv;
-    if (exists)
-        rv = defaultFile->CopyToNative(newProfDir, fileName);
-    else
-        rv = NS_ERROR_FILE_NOT_FOUND;
-
-	return rv;
-}
-
-nsresult
-nsProfile::DefineLocaleDefaultsDir()
-{
-    nsresult rv;
-    
-    nsCOMPtr<nsIProperties> directoryService = 
-             do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
-    NS_ENSURE_TRUE(directoryService, NS_ERROR_FAILURE);    
-
-    nsCOMPtr<nsIFile> localeDefaults;
-    rv = directoryService->Get(NS_APP_PROFILE_DEFAULTS_NLOC_50_DIR, NS_GET_IID(nsIFile), getter_AddRefs(localeDefaults));
-    if (NS_SUCCEEDED(rv))
-    {
-        nsCOMPtr<nsIChromeRegistrySea> packageRegistry = 
-                 do_GetService(NS_CHROMEREGISTRY_CONTRACTID, &rv);
-        if (NS_SUCCEEDED(rv))
-        {
-            nsCAutoString localeName;
-            rv = packageRegistry->GetSelectedLocale(NS_LITERAL_CSTRING("global-region"), localeName);
-            if (NS_SUCCEEDED(rv))
-                rv = localeDefaults->AppendNative(localeName);
-        }
-        rv = directoryService->Set(NS_APP_PROFILE_DEFAULTS_50_DIR, localeDefaults);
-    }
-    return rv;
-}
-
-// Migrate a selected profile
-// Set the profile to the current profile....debatable.
-// Calls PrefMigration service to do the Copy and Diverge
-// of 4x Profile information
-nsresult 
-nsProfile::MigrateProfileInternal(const PRUnichar* profileName,
-                                  nsIFile* oldProfDir,
-                                  nsIFile* newProfDir)
-{
-    NS_ENSURE_ARG_POINTER(profileName);   
-
-#if defined(DEBUG_profile)
-    printf("Inside Migrate Profile routine.\n" );
-#endif
-
-    // Call migration service to do the work.
-
-    nsresult rv;
-    nsCOMPtr <nsIPrefMigration> pPrefMigrator =
-            do_CreateInstance(kPrefMigrationCID, &rv);
-    if (NS_FAILED(rv)) return rv;
-        
-    nsCOMPtr<nsILocalFile> oldProfDirLocal(do_QueryInterface(oldProfDir, &rv));
-    if (NS_FAILED(rv)) return rv;    
-    nsCOMPtr<nsILocalFile> newProfDirLocal(do_QueryInterface(newProfDir, &rv));
-    if (NS_FAILED(rv)) return rv;
-        
-    nsCAutoString oldProfDirStr;
-    nsCAutoString newProfDirStr;
-
-    rv = oldProfDirLocal->GetPersistentDescriptor(oldProfDirStr);
-    if (NS_FAILED(rv)) return rv;
-    rv = newProfDirLocal->GetPersistentDescriptor(newProfDirStr);
-    if (NS_FAILED(rv)) return rv;
-
-    // you can do this a bunch of times.
-    rv = pPrefMigrator->AddProfilePaths(oldProfDirStr.get(), newProfDirStr.get());  
-
-    rv = pPrefMigrator->ProcessPrefs(PR_TRUE); // param is ignored
-    if (NS_FAILED(rv)) return rv;
-
-    // check for diskspace errors  
-    nsresult errorCode;   
-    errorCode = pPrefMigrator->GetError();
-
-    // In either of the cases below we have to return error to make
-    // app understand that migration has failed.
-    if (errorCode == MIGRATION_CREATE_NEW)
-    {
-        PRInt32 numProfiles = 0;
-        ShowProfileWizard();
-
-        // When the automigration process fails because of disk space error,
-        // we present user a create profile wizard if the user chooses to create a 
-        // a profile then. But then the user may click on cancel on that dialog...
-        // So, if the user clicks on cancel, the number of profiles should be 
-        // ZERO at the point for the user who failed to automigrate single 4x profile.
-        // On such condition, set mDiskSpaceErrorQuitCalled to allow user to quit the app.
-        // If the user is presented with profilemanager dialog with multiple 4x profiles
-        // to migrate, value of mDiskSpaceErrorQuitCalled does not matter as it gets ignored..
-        // If a single profile needs automigration and no confirmation 
-        // is needed for that operation mAutomigrate is set to false. 
-        if (!mAutomigrate)
-        {
-            GetProfileCount(&numProfiles);
-            if (numProfiles == 0)
-                mDiskSpaceErrorQuitCalled = PR_TRUE;
-        }
-        mOutofDiskSpace = PR_TRUE;
-        return NS_ERROR_FAILURE;
-    }
-    else if (errorCode == MIGRATION_CANCEL) 
-    {
-        // When the automigration process fails because of disk space error,
-        // user may choose to simply quit the app from the dialog presented 
-        // by pref-migrator. So, set mDiskSpaceErrorQuitCalled to allow user 
-        // to quit the app in such a case.
-        // If the user is presented with profilemanager dialog with multiple 4x profiles
-        // to migrate, value of mDiskSpaceErrorQuitCalled does not matter as it gets ignored..
-        // If a single profile needs automigration and no confirmation 
-        // is needed for that operation mAutomigrate is set to false. 
-        if (!mAutomigrate)
-            mDiskSpaceErrorQuitCalled = PR_TRUE;
-
-        ForgetCurrentProfile();
-        mOutofDiskSpace = PR_TRUE;
-        return NS_ERROR_FAILURE;
-    }
-    else if (errorCode != MIGRATION_SUCCESS) 
-    {
-        return NS_ERROR_FAILURE;
-    }
-
-    // No longer copying the default 5.0 profile files into
-    // the migrated profile. Check for them as requested.
-	
-    rv = SetProfileDir(profileName, newProfDir);
-    if (NS_FAILED(rv)) return rv;
-
-    gProfileDataAccess->SetMigratedFromDir(profileName, oldProfDirLocal);
-    gProfileDataAccess->mProfileDataChanged = PR_TRUE;
-    gProfileDataAccess->UpdateRegistry(nsnull);
-
-    return rv;
-}
-
-NS_IMETHODIMP 
-nsProfile::MigrateProfile(const PRUnichar* profileName)
-{
-    NS_ENSURE_ARG(profileName);   
-
-    nsresult rv = NS_OK;
-
-    nsCOMPtr<nsIFile> oldProfDir;    
-    nsCOMPtr<nsIFile> newProfDir;
-    nsCOMPtr<nsIPrefBranch> prefBranch;
-    nsXPIDLCString profMigDir;
- 
-    rv = GetProfileDir(profileName, getter_AddRefs(oldProfDir));
-    if (NS_FAILED(rv)) 
-      return rv;
-   
-    // Check PREF_MIGRATION_BEHAVIOR for how to set profiles root
-    // 0 - use NS_APP_USER_PROFILES_ROOT_DIR
-    // 1 - create one based on the NS4.x profile root
-    // 2 - use if not empty PREF_MIGRATION_DIRECTORY
-    PRInt32 profRootBehavior = 0;
-    nsCOMPtr<nsIPrefService> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
-    if (NS_SUCCEEDED(rv)) {
-      rv = prefs->GetBranch(nsnull, getter_AddRefs(prefBranch));
-      if (NS_SUCCEEDED(rv))
-        (void) prefBranch->GetIntPref(PREF_MIGRATION_BEHAVIOR, &profRootBehavior);
-    }
-
-    switch (profRootBehavior) {
-
-      case 1:
-        rv = oldProfDir->Clone(getter_AddRefs(newProfDir));
-        if (NS_FAILED(rv)) 
-          return rv;
-        rv = newProfDir->SetNativeLeafName(NS_LITERAL_CSTRING("Profiles"));
-        if (NS_FAILED(rv)) 
-          return rv;
-        break;
-
-      case 2:
-        rv = prefBranch->GetCharPref(PREF_MIGRATION_DIRECTORY, getter_Copies(profMigDir));
-        if (NS_SUCCEEDED(rv) && !profMigDir.IsEmpty()) {
-          nsCOMPtr<nsILocalFile> localFile(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv));
-          NS_ENSURE_SUCCESS(rv, rv);
-          rv = localFile->InitWithNativePath(nsDependentCString(profMigDir));
-          if (NS_SUCCEEDED(rv)) {
-            newProfDir = do_QueryInterface(localFile, &rv);
-            if (NS_FAILED(rv)) 
-              return rv;
-          }
-        }
-        break;
-
-      default:
-        break;
-
-    }
-    if (!newProfDir) {
-      rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILES_ROOT_DIR, getter_AddRefs(newProfDir));
-      if (NS_FAILED(rv)) 
-        return rv;
-    }
-
-    rv = newProfDir->Append(nsDependentString(profileName));
-    if (NS_FAILED(rv)) 
-      return rv;
-    
-    rv = newProfDir->CreateUnique(nsIFile::DIRECTORY_TYPE, 0700);
-    if (NS_FAILED(rv)) 
-      return rv;
-    
-    // always create level indirection when migrating
-    rv = AddLevelOfIndirection(newProfDir);
-    if (NS_FAILED(rv))
-      return rv;
-
-    return MigrateProfileInternal(profileName, oldProfDir, newProfDir);
-}
-
-NS_IMETHODIMP 
-nsProfile::RemigrateProfile(const PRUnichar* profileName)
-{
-    NS_ENSURE_ARG_POINTER(profileName);
-    
-    nsCOMPtr<nsIFile> profileDir;
-    nsresult rv = GetProfileDir(profileName, getter_AddRefs(profileDir));
-    NS_ENSURE_SUCCESS(rv,rv);
-
-    nsCOMPtr<nsIFile> newProfileDir;
-    rv = profileDir->Clone(getter_AddRefs(newProfileDir));
-    NS_ENSURE_SUCCESS(rv,rv);
-
-    // The profile list used by GetOriginalProfileDir is the one with ALL 4.x
-    // profiles - even ones for which there's a moz profile of the same name.
-    nsCOMPtr<nsILocalFile> oldProfileDir;
-    rv = GetOriginalProfileDir(profileName, getter_AddRefs(oldProfileDir));
-    NS_ENSURE_SUCCESS(rv,rv);
-
-    // In case of error, we'll restore what we've renamed.
-    nsCAutoString origDirLeafName;
-    rv = profileDir->GetNativeLeafName(origDirLeafName);
-    NS_ENSURE_SUCCESS(rv,rv);
-     
-    // leave <xxxxxxxx>.slt alone, 
-    // and remigrate the 4.x profile into <xxxxxxxx>.slt-new
-    nsCAutoString newDirLeafName(origDirLeafName + NS_LITERAL_CSTRING("-new"));
-    rv = newProfileDir->SetNativeLeafName(newDirLeafName);
-    NS_ENSURE_SUCCESS(rv,rv);
-    
-    // Create a new directory for the remigrated profile
-    rv = newProfileDir->CreateUnique(nsIFile::DIRECTORY_TYPE, 0700);
-    NS_ASSERTION(NS_SUCCEEDED(rv), "failed to create new directory for the remigrated profile");
-    if (NS_SUCCEEDED(rv)) {
-        rv = MigrateProfileInternal(profileName, oldProfileDir, newProfileDir);
-        NS_ASSERTION(NS_SUCCEEDED(rv), "MigrateProfileInternal failed");
-    }
-    return rv;
-}
-
-nsresult
-nsProfile::ShowProfileWizard(void)
-{
-    nsresult rv;
-    nsCOMPtr<nsIWindowWatcher> windowWatcher(do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv));
-    if (NS_FAILED(rv)) return rv;
-
-    nsCOMPtr<nsIDialogParamBlock> ioParamBlock(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID, &rv));
-    if (NS_FAILED(rv)) return rv;
-    ioParamBlock->SetInt(0,4); // standard wizard buttons
-   
-    nsCOMPtr<nsIDOMWindow> newWindow;
-    rv = windowWatcher->OpenWindow(nsnull,
-                                   PROFILE_WIZARD_URL,
-                                   "_blank",
-                                   kDefaultOpenWindowParams,
-                                   ioParamBlock,
-                                   getter_AddRefs(newWindow));
-    return rv;
-}
-
-NS_IMETHODIMP nsProfile::ProfileExists(const PRUnichar *profileName, PRBool *exists)
-{
-    NS_ENSURE_ARG_POINTER(profileName); 
-    NS_ENSURE_ARG_POINTER(exists);
-
-    *exists = gProfileDataAccess->ProfileExists(profileName);
-    return NS_OK;
-}
-
-NS_IMETHODIMP nsProfile::IsCurrentProfileAvailable(PRBool *available)
-{
-    NS_ENSURE_ARG_POINTER(available);
-
-    *available = mCurrentProfileAvailable;
-    return NS_OK;
-}
-
-// Gets the number of unmigrated 4x profiles
-// Location: Common/Profiles
-NS_IMETHODIMP nsProfile::Get4xProfileCount(PRInt32 *numProfiles)
-{
-    NS_ENSURE_ARG_POINTER(numProfiles);
-
-    *numProfiles = 0;
-
-    gProfileDataAccess->GetNum4xProfiles(numProfiles);
-    return NS_OK;
-}
-
-
-// Migrates all unmigrated profiles
-NS_IMETHODIMP nsProfile::MigrateAllProfiles()
-{
-    nsresult rv;
-
-    PRUint32    numOldProfiles = 0;
-    PRUnichar   **nameArray = nsnull;
-    rv = GetProfileListX(nsIProfileInternal::LIST_ONLY_OLD, &numOldProfiles, &nameArray);
-    if (NS_FAILED(rv)) return rv;
-    for (PRUint32 i = 0; i < numOldProfiles; i++)
-    {
-        rv = MigrateProfile(nameArray[i]);
-        if (NS_FAILED(rv)) break;
-    }
-    NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(numOldProfiles, nameArray);
-    return rv;
-}
-
-
-NS_IMETHODIMP nsProfile::CloneProfile(const PRUnichar* newProfile)
-{
-    NS_ENSURE_ARG_POINTER(newProfile);   
-
-    nsresult rv = NS_OK;
-
-#if defined(DEBUG_profile)
-    printf("ProfileManager : CloneProfile\n");
-#endif
-    
-    nsCOMPtr<nsIFile> currProfileDir;
-    rv = GetCurrentProfileDir(getter_AddRefs(currProfileDir));
-    if (NS_FAILED(rv)) return rv;
-
-    PRBool exists;    
-    rv = currProfileDir->Exists(&exists);
-    if (NS_SUCCEEDED(rv) && exists)
-    {
-        nsCOMPtr<nsIFile> aFile;
-        rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILES_ROOT_DIR, getter_AddRefs(aFile));
-        if (NS_FAILED(rv)) return rv;
-        nsCOMPtr<nsILocalFile> destDir(do_QueryInterface(aFile, &rv));
-        if (NS_FAILED(rv)) return rv;
-        destDir->AppendRelativePath(nsDependentString(newProfile));
-
-        // Find a unique name in the dest dir
-        rv = destDir->CreateUnique(nsIFile::DIRECTORY_TYPE, 0700);
-        if (NS_FAILED(rv)) return rv;
-        
-        rv = RecursiveCopy(currProfileDir, destDir);
-        if (NS_FAILED(rv)) return rv;           
-        rv = SetProfileDir(newProfile, destDir);
-    }
-
-#if defined(DEBUG_profile_verbose)
-    {
-      if (NS_SUCCEEDED(rv))
-      printf("ProfileManager : Cloned CurrentProfile\n");
-
-      nsCAutoString temp; temp.AssignWithConversion(newProfile);
-      printf("The new profile is ->%s<-\n", temp.get());
-    }
-#endif
-
-    gProfileDataAccess->mProfileDataChanged = PR_TRUE;
-
-    return rv;
-}
-
-nsresult
-nsProfile::CreateDefaultProfile(void)
-{
-    nsresult rv = NS_OK;
-
-    // Get the default user profiles folder
-    nsCOMPtr<nsIFile> profileRootDir;
-    rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILES_ROOT_DIR, getter_AddRefs(profileRootDir));
-    if (NS_FAILED(rv)) return rv;
-    
-    nsAutoString profilePath;
-    rv = profileRootDir->GetPath(profilePath);
-    if (NS_FAILED(rv)) return rv;
-
-    rv = CreateNewProfile(DEFAULT_PROFILE_NAME, profilePath.get(), nsnull, PR_TRUE);
-
-    return rv;
-}
-
-NS_IMETHODIMP 
-nsProfile::UpdateRegistry(nsIFile* regName)
-{
-   nsresult rv = NS_OK;
-
-   gProfileDataAccess->mProfileDataChanged = PR_TRUE;
-   rv= gProfileDataAccess->UpdateRegistry(regName);
-
-   return rv;
-}
-
-NS_IMETHODIMP 
-nsProfile::SetRegStrings(const PRUnichar* profileName, 
-                         const PRUnichar* regString,
-                         const PRUnichar* regName,
-                         const PRUnichar* regEmail,
-                         const PRUnichar* regOption)
-{
-   nsresult rv = NS_OK;
-
-   ProfileStruct*    aProfile;
-
-   rv = gProfileDataAccess->GetValue(profileName, &aProfile);
-   if (NS_FAILED(rv)) return rv;
-
-   if (aProfile == nsnull)
-     return NS_ERROR_FAILURE;
-   
-   aProfile->NCHavePregInfo = regString;
-
-   if (regName)    aProfile->NCProfileName   = regName;
-   if (regEmail)   aProfile->NCEmailAddress  = regEmail;
-   if (regOption)  aProfile->NCDeniedService = regOption;
-
-   gProfileDataAccess->SetValue(aProfile);
-
-   delete aProfile;
-
-   return rv;
-}
-
-NS_IMETHODIMP 
-nsProfile::IsRegStringSet(const PRUnichar *profileName, char **regString)
-{
-    NS_ENSURE_ARG_POINTER(profileName);   
-    NS_ENSURE_ARG_POINTER(regString);
-
-    gProfileDataAccess->CheckRegString(profileName, regString);
-    return NS_OK;
-}
-
-/*
- * nsIProfileChangeStatus Implementation
- */
-
-NS_IMETHODIMP nsProfile::VetoChange()
-{
-    mProfileChangeVetoed = PR_TRUE;
-    return NS_OK;
-}
-
-NS_IMETHODIMP nsProfile::ChangeFailed()
-{
-    mProfileChangeFailed = PR_TRUE;
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-nsProfile::GetRegStrings(const PRUnichar *aProfileName, 
-                        PRUnichar **aRegString, 
-                        PRUnichar **aRegName, 
-                        PRUnichar **aRegEmail, 
-                        PRUnichar **aRegOption)
-{
-    NS_ENSURE_ARG_POINTER(aProfileName);
-    NS_ENSURE_ARG_POINTER(aRegString);
-    NS_ENSURE_ARG_POINTER(aRegName);
-    NS_ENSURE_ARG_POINTER(aRegEmail);
-    NS_ENSURE_ARG_POINTER(aRegOption);
-
-    ProfileStruct*    profileVal;
-
-    nsresult rv = gProfileDataAccess->GetValue(aProfileName, &profileVal);
-    if (NS_FAILED(rv)) 
-      return rv;
-
-    if (profileVal == nsnull)
-      return NS_ERROR_FAILURE;
-
-    *aRegString = ToNewUnicode(profileVal->NCHavePregInfo);
-    if (!*aRegString)
-      return NS_ERROR_OUT_OF_MEMORY;    
-
-    *aRegName = ToNewUnicode(profileVal->NCProfileName);
-    if (!*aRegName)
-      return NS_ERROR_OUT_OF_MEMORY;    
-
-    *aRegEmail = ToNewUnicode(profileVal->NCEmailAddress);
-    if (!*aRegEmail)
-      return NS_ERROR_OUT_OF_MEMORY;    
-
-    *aRegOption = ToNewUnicode(profileVal->NCDeniedService);
-    if (!*aRegOption)
-      return NS_ERROR_OUT_OF_MEMORY;    
-
-     delete profileVal;
-
-     return NS_OK;
-}
-
-nsresult nsProfile::GetLocalProfileDir(const PRUnichar* aProfileName,
-                                       nsIFile** aLocalDir)
-{
-  *aLocalDir = nsnull;
-  nsresult rv;
-  nsCOMPtr<nsIProperties> directoryService = 
-    do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
-  if (NS_FAILED(rv))
-    return rv;
-  nsCOMPtr<nsIFile> localDir;
-  rv = directoryService->Get(NS_APP_USER_PROFILES_LOCAL_ROOT_DIR,
-                             NS_GET_IID(nsIFile),
-                             getter_AddRefs(localDir));
-  if (NS_FAILED(rv))
-    return rv;
-  rv = localDir->Append(nsDependentString(aProfileName));
-  if (NS_FAILED(rv))
-    return rv;
-  localDir.swap(*aLocalDir);
-  return NS_OK;
-}
deleted file mode 100644
--- a/profile/src/nsProfile.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * 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 ***** */
-
-#include "nsIProfile.h"
-#include "nsIProfileInternal.h"
-#include "nsIProfileStartupListener.h"
-#include "nsIProfileChangeStatus.h"
-#include "nsCOMPtr.h"
-#include "nsISupports.h"
-#include "nsIRegistry.h"
-#include "nsString.h"
-#include "nsICmdLineService.h"
-#include "nsProfileAccess.h"
-
-// Interfaces Needed
-#include "nsIXULWindow.h"
-#include "nsIInterfaceRequestor.h"
-#include "nsIInterfaceRequestorUtils.h"
-#include "nsIURIContentListener.h"
-#include "nsIDirectoryService.h"
-
-#define _MAX_LENGTH   256
-
-class nsProfile: public nsIProfileInternal,
-                 public nsIProfileChangeStatus
-{
-    NS_DECL_ISUPPORTS
-    NS_DECL_NSIPROFILE
-    NS_DECL_NSIPROFILEINTERNAL
-    NS_DECL_NSIPROFILECHANGESTATUS
-
-private:
-    nsresult ProcessArgs(nsICmdLineService *service,
-                         PRBool canInteract,
-                         PRBool *profileDirSet,
-                         nsCString & profileURLStr);
-    nsresult LoadDefaultProfileDir(nsCString & profileURLStr, PRBool canInterract);
-	nsresult ConfirmAutoMigration(PRBool canInteract, PRBool *confirmed);
-	nsresult CopyDefaultFile(nsIFile *profDefaultsDir,
-	                         nsIFile *newProfDir,
-                             const nsACString &fileName);
-	nsresult LoadNewProfilePrefs();
-    nsresult SetProfileDir(const PRUnichar *profileName, nsIFile *profileDir);
-								
-    nsresult AddLevelOfIndirection(nsIFile *aDir);
-    nsresult IsProfileDirSalted(nsIFile *profileDir, PRBool *isSalted);
-    nsresult DefineLocaleDefaultsDir();
-    nsresult Update4xProfileInfo();
-    nsresult GetOldRegLocation(nsIFile **aOldRegFile);
-    nsresult UpdateCurrentProfileModTime(PRBool updateRegistry);
-    nsresult MigrateProfileInternal(const PRUnichar *profileName,
-                                    nsIFile *oldProfDir, nsIFile *newProfDir);
-
-    nsresult GetLocalProfileDir(const PRUnichar *profileName, nsIFile** localDir);
-
-    PRBool mStartingUp;
-    PRBool mAutomigrate;
-    PRBool mOutofDiskSpace;
-    PRBool mDiskSpaceErrorQuitCalled;
-    PRBool mProfileChangeVetoed;
-    PRBool mProfileChangeFailed;
-
-    nsString mCurrentProfileName;
-    PRBool mCurrentProfileAvailable;
-
-    PRBool mIsUILocaleSpecified;
-    nsCString mUILocaleName;
-
-    PRBool mIsContentLocaleSpecified;
-    nsCString mContentLocaleName;
-    
-    PRBool mShutdownProfileToreDownNetwork;
-    
-public:
-    nsProfile();
-    virtual ~nsProfile();
-    
-    nsresult Init();
-
-    // Copies all the registry keys from old profile to new profile
-    nsresult CopyRegKey(const PRUnichar *oldProfile, const PRUnichar *newProfile);
-
-    nsresult AutoMigrate();
-
-    nsresult ShowProfileWizard(void);
-};
-
-
deleted file mode 100644
--- a/profile/src/nsProfileAccess.cpp
+++ /dev/null
@@ -1,1532 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org Code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Pierre Phaneuf <pp@ludusdesign.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * 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 ***** */
-
-#include "nsProfileAccess.h"
-#include "nsProfile.h"
-
-#include "pratom.h"
-#include "prmem.h"
-#include "plstr.h"
-#include "prenv.h"
-
-#include "nsIEnumerator.h"
-#include "prprf.h"
-#include "nsCOMPtr.h"
-#include "nsIComponentManager.h"
-#include "nsEscape.h"
-#include "nsDirectoryServiceDefs.h"
-#include "nsAppDirectoryServiceDefs.h"
-#include "nsILocalFile.h"
-#include "nsReadableUtils.h"
-#include "nsNativeCharsetUtils.h"
-
-#if defined(XP_MAC) || defined(XP_MACOSX)
-#include <Processes.h>
-#include <CFBundle.h>
-#include "nsILocalFileMac.h"
-#endif
-
-#ifdef XP_UNIX
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <signal.h>
-#include "prnetdb.h"
-#include "prsystem.h"
-#endif
-
-#ifdef VMS
-#include <rmsdef.h>
-#endif
-
-#if defined (XP_UNIX)
-#define USER_ENVIRONMENT_VARIABLE "USER"
-#define LOGNAME_ENVIRONMENT_VARIABLE "LOGNAME"
-#define HOME_ENVIRONMENT_VARIABLE "HOME"
-#define PROFILE_NAME_ENVIRONMENT_VARIABLE "PROFILE_NAME"
-#define PROFILE_HOME_ENVIRONMENT_VARIABLE "PROFILE_HOME"
-#define DEFAULT_UNIX_PROFILE_NAME "default"
-#ifndef XP_MACOSX   /* Don't use symlink-based locking on OS X */
-#define USE_SYMLINK_LOCKING
-#endif
-#elif defined (XP_BEOS)
-#endif
-
-// Registry Keys
-
-#define kRegistryYesString (NS_LITERAL_STRING("yes"))
-#define kRegistryNoString (NS_LITERAL_STRING("no"))
-
-#define kRegistryProfileSubtreeString (NS_LITERAL_STRING("Profiles"))
-#define kRegistryCurrentProfileString (NS_LITERAL_STRING("CurrentProfile"))
-#define kRegistryNCServiceDenialString (NS_LITERAL_STRING("NCServiceDenial"))
-#define kRegistryNCProfileNameString (NS_LITERAL_STRING("NCProfileName"))
-#define kRegistryNCUserEmailString (NS_LITERAL_STRING("NCEmailAddress"))
-#define kRegistryNCHavePREGInfoString (NS_LITERAL_STRING("NCHavePregInfo"))
-#define kRegistryHavePREGInfoString (NS_LITERAL_STRING("HavePregInfo"))
-#define kRegistryMigratedString (NS_LITERAL_STRING("migrated"))
-#define kRegistryDirectoryString (NS_LITERAL_STRING("directory"))
-#define kRegistryNeedMigrationString (NS_LITERAL_STRING("NeedMigration"))
-#define kRegistryMozRegDataMovedString (NS_LITERAL_STRING("OldRegDataMoved"))
-#define kRegistryCreationTimeString (NS_LITERAL_CSTRING("CreationTime"))
-#define kRegistryLastModTimeString (NS_LITERAL_CSTRING("LastModTime"))
-#define kRegistryMigratedFromString (NS_LITERAL_CSTRING("MigFromDir"))
-#define kRegistryVersionString (NS_LITERAL_STRING("Version"))
-#define kRegistryVersion_1_0 (NS_LITERAL_STRING("1.0"))
-#define kRegistryCurrentVersion (NS_LITERAL_STRING("1.0"))
-#define kRegistryStartWithLastString (NS_LITERAL_CSTRING("AutoStartWithLast"))
-
-// **********************************************************************
-// class nsProfileAccess
-// **********************************************************************
-
-/*
- * Constructor/Destructor
- * FillProfileInfo reads the registry and fills profileStructs
- */
-nsProfileAccess::nsProfileAccess()
-{
-    mProfileDataChanged  =  PR_FALSE;
-    mForgetProfileCalled =  PR_FALSE;
-    m4xProfilesAdded     =  PR_FALSE;
-    mStartWithLastProfile = PR_FALSE;
-    mProfiles            =  new nsVoidArray();
-
-    // Get the profile registry path
-    NS_GetSpecialDirectory(NS_APP_APPLICATION_REGISTRY_FILE, getter_AddRefs(mNewRegFile));
-
-    // Read the data into internal data structure....
-    FillProfileInfo(mNewRegFile);
-}
-
-// On the way out, close the registry if it is
-// still opened and free up the resources.
-nsProfileAccess::~nsProfileAccess()
-{
-    // Release all resources.
-    mNewRegFile = nsnull;
-    FreeProfileMembers(mProfiles);
-}
-
-// Free up the member profile structs
-void
-nsProfileAccess::FreeProfileMembers(nsVoidArray *profiles)
-{
-    NS_ASSERTION(profiles, "Invalid profiles");
-
-    PRInt32 index = 0;
-    PRInt32 numElems = profiles->Count();
-
-    ProfileStruct* aProfile;
-    if (profiles) {
-        for (index = 0; index < numElems; index++)
-        {
-            aProfile = (ProfileStruct *) profiles->ElementAt(index);
-
-            delete aProfile;
-        }
-
-        delete profiles;
-    }
-}
-
-
-// Given the name of the profile, the structure that
-// contains the relavant profile information will be filled.
-// Caller must free up the profile struct.
-nsresult
-nsProfileAccess::GetValue(const PRUnichar* profileName, ProfileStruct** aProfile)
-{
-    NS_ENSURE_ARG(profileName);
-    NS_ENSURE_ARG_POINTER(aProfile);
-    *aProfile = nsnull;
-
-    PRInt32 index = 0;
-    index = FindProfileIndex(profileName, PR_FALSE);
-    if (index < 0)
-        return NS_ERROR_FAILURE;
-
-    ProfileStruct* profileItem = (ProfileStruct *) (mProfiles->ElementAt(index));
-
-    *aProfile = new ProfileStruct(*profileItem);
-    if (!*aProfile)
-        return NS_ERROR_OUT_OF_MEMORY;
-
-    return NS_OK;
-}
-
-// This method writes all changes to the array of the
-// profile structs. If it is an existing profile, it
-// will be updated. If it is a new profile, it gets added
-// to the list.
-nsresult
-nsProfileAccess::SetValue(ProfileStruct* aProfile)
-{
-    NS_ENSURE_ARG(aProfile);
-
-    PRInt32     index = 0;
-    ProfileStruct* profileItem;
-
-    index = FindProfileIndex(aProfile->profileName.get(), aProfile->isImportType);
-
-    if (index >= 0)
-    {
-        profileItem = (ProfileStruct *) (mProfiles->ElementAt(index));
-        *profileItem = *aProfile;
-        profileItem->updateProfileEntry = PR_TRUE;
-    }
-    else
-    {
-        profileItem     = new ProfileStruct(*aProfile);
-        if (!profileItem)
-            return NS_ERROR_OUT_OF_MEMORY;
-    profileItem->updateProfileEntry = PR_TRUE;
-
-        if (!mProfiles) {
-            mProfiles = new nsVoidArray;
-        if (!mProfiles)
-                return NS_ERROR_OUT_OF_MEMORY;
-        }
-        mProfiles->AppendElement((void*)profileItem);
-    }
-
-    return NS_OK;
-}
-
-// Enumerates through the registry for profile
-// information. Reads in the data into the array
-// of profile structs. After this, all the callers
-// requesting profile info will get thier data from
-// profiles array. All the udates will be done to this
-// data structure to reflect the latest status.
-// Data will be flushed at the end.
-nsresult
-nsProfileAccess::FillProfileInfo(nsIFile* regName)
-{
-    nsresult rv = NS_OK;
-
-    nsCOMPtr<nsIRegistry> registry(do_CreateInstance(NS_REGISTRY_CONTRACTID, &rv));
-    if (NS_FAILED(rv)) return rv;
-    rv = registry->Open(regName);
-    if (NS_FAILED(rv)) return rv;
-
-    // Enumerate all subkeys (immediately) under the given node.
-    nsCOMPtr<nsIEnumerator> enumKeys;
-    nsRegistryKey profilesTreeKey;
-
-    rv = registry->GetKey(nsIRegistry::Common,
-                            kRegistryProfileSubtreeString.get(),
-                            &profilesTreeKey);
-
-    if (NS_FAILED(rv))
-    {
-        rv = registry->AddKey(nsIRegistry::Common,
-                                kRegistryProfileSubtreeString.get(),
-                                &profilesTreeKey);
-        if (NS_FAILED(rv)) return rv;
-    }
-
-
-    // introducing these tmp variables as nsString variables cannot be passed to
-    // the resgitry methods
-    nsXPIDLString tmpCurrentProfile;
-    nsXPIDLString tmpVersion;
-    nsXPIDLString tmpPREGInfo;
-
-
-    // For the following variables, we do not check for the rv value
-    // but check for the variable instead, because it is valid to proceed
-    // without the variables having a value. That's why there are no returns
-    // for invalid rv values.
-
-    // Get the current profile
-    rv = registry->GetString(profilesTreeKey,
-                               kRegistryCurrentProfileString.get(),
-                               getter_Copies(tmpCurrentProfile));
-
-    if (tmpCurrentProfile)
-    {
-        // If current profile does not exist, mCurrentProfile will not be set
-        // This is not harmful, as GetCurrentProfile method needs to return this value
-        // And GetCurrentProfile returns:
-        //    the current profile if set
-        //    the first profile if profiles exist but no current profile is set
-        //    an empty string if no profiles exist.
-
-        mCurrentProfile = static_cast<const PRUnichar*>(tmpCurrentProfile);
-    }
-
-    // Get the profile version
-    rv = registry->GetString(profilesTreeKey,
-                             kRegistryVersionString.get(),
-                             getter_Copies(tmpVersion));
-
-    // Get the preg info
-    rv = registry->GetString(profilesTreeKey,
-                             kRegistryHavePREGInfoString.get(),
-                             getter_Copies(tmpPREGInfo));
-
-    if (tmpPREGInfo == nsnull)
-    {
-        mHavePREGInfo = kRegistryNoString;
-        mProfileDataChanged = PR_TRUE;
-    }
-    
-    // Get the StartWithLastProfile flag
-    PRInt32 tempLong;
-    rv = registry->GetInt(profilesTreeKey,
-                           kRegistryStartWithLastString.get(),
-                           &tempLong);
-    if (NS_SUCCEEDED(rv))
-        mStartWithLastProfile = tempLong;
-
-    rv = registry->EnumerateSubtrees( profilesTreeKey, getter_AddRefs(enumKeys));
-    if (NS_FAILED(rv)) return rv;
-
-    rv = enumKeys->First();
-    if (NS_FAILED(rv)) return rv;
-
-    PRBool currentProfileValid = mCurrentProfile.IsEmpty();
-
-    while (NS_OK != enumKeys->IsDone())
-    {
-        nsCOMPtr<nsISupports> base;
-
-        rv = enumKeys->CurrentItem( getter_AddRefs(base) );
-        if (NS_FAILED(rv)) return rv;
-
-        // Get specific interface.
-        nsCOMPtr <nsIRegistryNode> node;
-        nsIID nodeIID = NS_IREGISTRYNODE_IID;
-
-        rv = base->QueryInterface( nodeIID, getter_AddRefs(node));
-        if (NS_FAILED(rv)) return rv;
-
-        // Get node name.
-        nsXPIDLString profile;
-        nsXPIDLString isMigrated;
-        nsXPIDLString NCProfileName;
-        nsXPIDLString NCDeniedService;
-        nsXPIDLString NCEmailAddress;
-        nsXPIDLString NCHavePregInfo;
-
-        rv = node->GetName(getter_Copies(profile));
-        if (NS_FAILED(rv)) return rv;
-
-        nsRegistryKey profKey;
-        rv = node->GetKey(&profKey);
-        if (NS_FAILED(rv)) return rv;
-
-        rv = registry->GetString(profKey,
-                                 kRegistryMigratedString.get(),
-                                 getter_Copies(isMigrated));
-        if (NS_FAILED(rv)) return rv;
-        nsDependentString isMigratedString(isMigrated);
-
-        // Not checking the return values of these variables as they
-        // are for activation, they are optional and their values
-        // do not call for a return
-        registry->GetString(profKey,
-                            kRegistryNCProfileNameString.get(),
-                            getter_Copies(NCProfileName));
-
-        registry->GetString(profKey,
-                            kRegistryNCServiceDenialString.get(),
-                            getter_Copies(NCDeniedService));
-
-        registry->GetString(profKey,
-                            kRegistryNCUserEmailString.get(),
-                            getter_Copies(NCEmailAddress));
-
-        registry->GetString(profKey,
-                            kRegistryNCHavePREGInfoString.get(),
-                            getter_Copies(NCHavePregInfo));
-
-        // Make sure that mCurrentProfile is valid
-        if (!mCurrentProfile.IsEmpty() && mCurrentProfile.Equals(profile))
-          currentProfileValid = PR_TRUE;
-
-        ProfileStruct*  profileItem     = new ProfileStruct();
-        if (!profileItem)
-            return NS_ERROR_OUT_OF_MEMORY;
-
-        profileItem->updateProfileEntry     = PR_TRUE;
-        profileItem->profileName      = static_cast<const PRUnichar*>(profile);
-
-        PRInt64 tmpLongLong;
-        rv = registry->GetLongLong(profKey,
-                                   kRegistryCreationTimeString.get(),
-                                   &tmpLongLong);
-        if (NS_SUCCEEDED(rv))
-            profileItem->creationTime = tmpLongLong;
-
-        rv = registry->GetLongLong(profKey,
-                                   kRegistryLastModTimeString.get(),
-                                   &tmpLongLong);
-        if (NS_SUCCEEDED(rv))
-            profileItem->lastModTime = tmpLongLong;
-
-        rv = profileItem->InternalizeLocation(registry, profKey, PR_FALSE);
-        NS_ASSERTION(NS_SUCCEEDED(rv), "Internalizing profile location failed");
-        // Not checking the error since most won't have this info
-        profileItem->InternalizeMigratedFromLocation(registry, profKey);
-
-        profileItem->isMigrated       = isMigratedString.Equals(kRegistryYesString);
-
-        if (NCProfileName)
-            profileItem->NCProfileName = static_cast<const PRUnichar*>(NCProfileName);
-
-        if (NCDeniedService)
-            profileItem->NCDeniedService = static_cast<const PRUnichar*>(NCDeniedService);
-
-        if (NCEmailAddress)
-            profileItem->NCEmailAddress = static_cast<const PRUnichar*>(NCEmailAddress);
-
-        if (NCHavePregInfo)
-            profileItem->NCHavePregInfo = static_cast<const PRUnichar*>(NCHavePregInfo);
-
-        profileItem->isImportType = PR_FALSE;
-        if (!mProfiles) {
-            mProfiles = new nsVoidArray();
-
-            if (!mProfiles) {
-                delete profileItem;
-                return NS_ERROR_OUT_OF_MEMORY;
-            }
-        }
-
-        mProfiles->AppendElement((void*)profileItem);
-
-        rv = enumKeys->Next();
-        if (NS_FAILED(rv)) return rv;
-    }
-
-    if (!currentProfileValid)
-      mCurrentProfile.SetLength(0);
-
-    return rv;
-}
-
-// Return the number of 5x profiles.
-void
-nsProfileAccess::GetNumProfiles(PRInt32 *numProfiles)
-{
-    if (!numProfiles) {
-        NS_ASSERTION(PR_FALSE, "invalid argument");
-        return;
-    }
-
-    PRInt32 index, numElems = mProfiles->Count();
-
-    *numProfiles = 0;
-
-    for(index = 0; index < numElems; index++)
-    {
-        ProfileStruct* profileItem = (ProfileStruct *) (mProfiles->ElementAt(index));
-
-        if (profileItem->isMigrated && !profileItem->isImportType)
-        {
-            (*numProfiles)++;
-        }
-    }
-}
-
-// Return the number of 4x (>=4.5 & < 5.0) profiles.
-void
-nsProfileAccess::GetNum4xProfiles(PRInt32 *numProfiles)
-{
-    if (!numProfiles) {
-        NS_ASSERTION(PR_FALSE, "invalid argument");
-        return;
-    }
-
-    PRInt32 index, numElems = mProfiles->Count();
-
-    *numProfiles = 0;
-
-    for(index = 0; index < numElems; index++)
-    {
-        ProfileStruct* profileItem = (ProfileStruct *) (mProfiles->ElementAt(index));
-
-        if (!profileItem->isMigrated && !profileItem->isImportType)
-        {
-            (*numProfiles)++;
-        }
-    }
-}
-
-// If the application can't find the current profile,
-// the first profile will be used as the current profile.
-// This routine returns the first 5x profile.
-// Caller must free up the string (firstProfile).
-void
-nsProfileAccess::GetFirstProfile(PRUnichar **firstProfile)
-{
-    if (!firstProfile) {
-        NS_ASSERTION(PR_FALSE, "Invalid firstProfile pointer");
-        return;
-    }
-
-    PRInt32 index, numElems = mProfiles->Count();
-
-    *firstProfile = nsnull;
-
-    for(index = 0; index < numElems; index++)
-    {
-        ProfileStruct* profileItem = (ProfileStruct *) (mProfiles->ElementAt(index));
-
-        if (profileItem->isMigrated && !profileItem->isImportType)
-        {
-            *firstProfile = ToNewUnicode(profileItem->profileName);
-            break;
-        }
-    }
-}
-
-// Set the current profile. Opearting directly on the tree.
-// A separate struct should be maintained for the top level info.
-// That way we can eliminate additional registry access. For
-// now, we depend on registry operations.
-// Capture the current profile information into mCurrentProfile.
-void
-nsProfileAccess::SetCurrentProfile(const PRUnichar *profileName)
-{
-    NS_ASSERTION(profileName, "Invalid profile name");
-
-    mCurrentProfile = profileName;
-    mProfileDataChanged = PR_TRUE;
-}
-
-// Return the current profile value.
-// If mCurrent profile is already set, that value is returned.
-// If there is only one profile that value is set to CurrentProfile.
-void
-nsProfileAccess::GetCurrentProfile(PRUnichar **profileName)
-{
-    *profileName = nsnull;
-
-    if (!mCurrentProfile.IsEmpty() || mForgetProfileCalled)
-    {
-        *profileName = ToNewUnicode(mCurrentProfile);
-    }
-
-    // If there are profiles and profileName is not
-    // set yet. Get the first one and set it as Current Profile.
-    if (*profileName == nsnull)
-    {
-        GetFirstProfile(profileName); // We might not have any
-        if (*profileName)
-            SetCurrentProfile(*profileName);
-    }
-}
-
-// Delete a profile from profile structs
-void
-nsProfileAccess::RemoveSubTree(const PRUnichar* profileName)
-{
-    NS_ASSERTION(profileName, "Invalid profile name");
-
-    // delete this entry from the mProfiles array
-    PRInt32     index = FindProfileIndex(profileName, PR_FALSE);
-
-    if (index >= 0)
-    {
-        mProfiles->RemoveElementAt(index);
-
-        if (mCurrentProfile.Equals(profileName))
-        {
-            mCurrentProfile.SetLength(0);
-        }
-    }
-}
-
-// Return the index of a given profiel from the arraf of profile structs.
-PRInt32
-nsProfileAccess::FindProfileIndex(const PRUnichar* profileName, PRBool forImport)
-{
-    NS_ASSERTION(profileName, "Invalid profile name");
-
-    PRInt32 retval = -1;
-    PRInt32 index, numElems = mProfiles->Count();
-
-    for (index=0; index < numElems; index++)
-    {
-        ProfileStruct* profileItem = (ProfileStruct *) (mProfiles->ElementAt(index));
-
-        if(profileItem->profileName.Equals(profileName) && (profileItem->isImportType == forImport))
-        {
-            retval = index;
-            break;
-        }
-    }
-    return retval;
-}
-
-// Flush profile information from the data structure to the registry.
-nsresult
-nsProfileAccess::UpdateRegistry(nsIFile* regName)
-{
-    nsresult rv;
-
-    if (!mProfileDataChanged)
-    {
-        return NS_OK;
-    }
-
-    if (!regName)
-    {
-        regName = mNewRegFile;
-    }
-
-    nsCOMPtr<nsIRegistry> registry(do_CreateInstance(NS_REGISTRY_CONTRACTID, &rv));
-    if (NS_FAILED(rv)) return rv;
-    rv = registry->Open(regName);
-    if (NS_FAILED(rv)) return rv;
-
-    // Enumerate all subkeys (immediately) under the given node.
-    nsCOMPtr<nsIEnumerator> enumKeys;
-    nsRegistryKey profilesTreeKey;
-
-    // Get the major subtree
-    rv = registry->GetKey(nsIRegistry::Common,
-                          kRegistryProfileSubtreeString.get(),
-                          &profilesTreeKey);
-    if (NS_FAILED(rv))
-    {
-        rv = registry->AddKey(nsIRegistry::Common,
-                                kRegistryProfileSubtreeString.get(),
-                                &profilesTreeKey);
-        if (NS_FAILED(rv)) return rv;
-    }
-
-    // Set the current profile
-    if (!mCurrentProfile.IsEmpty()) {
-
-        rv = registry->SetString(profilesTreeKey,
-                                 kRegistryCurrentProfileString.get(),
-                                 mCurrentProfile.get());
-        if (NS_FAILED(rv)) return rv;
-    }
-
-    // Set the registry version
-    rv = registry->SetString(profilesTreeKey,
-                             kRegistryVersionString.get(),
-                             kRegistryCurrentVersion.get());
-    if (NS_FAILED(rv)) return rv;
-
-    // Set preg info
-    rv = registry->SetString(profilesTreeKey,
-                             kRegistryHavePREGInfoString.get(),
-                             mHavePREGInfo.get());
-    if (NS_FAILED(rv)) return rv;
-
-    // Set the StartWithLastProfile flag
-    rv = registry->SetInt(profilesTreeKey,
-                          kRegistryStartWithLastString.get(),
-                          mStartWithLastProfile);
-    if (NS_FAILED(rv)) return rv;
-
-    rv = registry->EnumerateSubtrees(profilesTreeKey, getter_AddRefs(enumKeys));
-    if (NS_FAILED(rv)) return rv;
-
-    rv = enumKeys->First();
-    if (NS_FAILED(rv)) return rv;
-
-    while (NS_OK != enumKeys->IsDone())
-    {
-        nsCOMPtr<nsISupports> base;
-
-        rv = enumKeys->CurrentItem( getter_AddRefs(base) );
-        if (NS_FAILED(rv)) return rv;
-
-        // Get specific interface.
-        nsCOMPtr <nsIRegistryNode> node;
-        nsIID nodeIID = NS_IREGISTRYNODE_IID;
-
-        rv = base->QueryInterface( nodeIID, getter_AddRefs(node));
-        if (NS_FAILED(rv)) return rv;
-
-        // Get node name.
-        nsXPIDLString profile;
-        nsXPIDLString isMigrated;
-        nsXPIDLString directory;
-
-        rv = node->GetName( getter_Copies(profile) );
-        if (NS_FAILED(rv)) return rv;
-
-        PRInt32 index = 0;
-
-        index = FindProfileIndex(profile, PR_FALSE);
-
-        if (index < 0)
-        {
-            // This profile is deleted.
-            rv = registry->RemoveKey(profilesTreeKey, profile);
-            if (NS_FAILED(rv)) return rv;
-        }
-        else
-        {
-            nsRegistryKey profKey;
-
-            ProfileStruct* profileItem = (ProfileStruct *) (mProfiles->ElementAt(index));
-
-            rv = node->GetKey(&profKey);
-            if (NS_FAILED(rv)) return rv;
-
-            rv = registry->SetString(profKey,
-                                     kRegistryMigratedString.get(),
-                                     profileItem->isMigrated ? kRegistryYesString.get() : kRegistryNoString.get());
-            if (NS_FAILED(rv)) return rv;
-
-            registry->SetString(profKey,
-                                kRegistryNCProfileNameString.get(),
-                                profileItem->NCProfileName.get());
-
-            registry->SetString(profKey,
-                                kRegistryNCServiceDenialString.get(),
-                                profileItem->NCDeniedService.get());
-
-            registry->SetString(profKey,
-                                kRegistryNCUserEmailString.get(),
-                                profileItem->NCEmailAddress.get());
-
-            registry->SetString(profKey,
-                                kRegistryNCHavePREGInfoString.get(),
-                                profileItem->NCHavePregInfo.get());
-
-            registry->SetLongLong(profKey,
-                                  kRegistryCreationTimeString.get(),
-                                  &profileItem->creationTime);
-
-            registry->SetLongLong(profKey,
-                                  kRegistryLastModTimeString.get(),
-                                  &profileItem->lastModTime);
-
-            rv = profileItem->ExternalizeLocation(registry, profKey);
-            if (NS_FAILED(rv)) {
-                NS_ASSERTION(PR_FALSE, "Could not update profile location");
-                rv = enumKeys->Next();
-                if (NS_FAILED(rv)) return rv;
-                continue;
-            }
-            profileItem->ExternalizeMigratedFromLocation(registry, profKey);
-
-            profileItem->updateProfileEntry = PR_FALSE;
-        }
-        rv = enumKeys->Next();
-        if (NS_FAILED(rv)) return rv;
-    }
-
-    // Take care of new nodes
-    PRInt32 numElems = mProfiles->Count();
-    for (int i = 0; i < numElems; i++)
-    {
-        ProfileStruct* profileItem = (ProfileStruct *) (mProfiles->ElementAt(i));
-
-        if (!profileItem->isImportType && profileItem->updateProfileEntry)
-        {
-            nsRegistryKey profKey;
-
-            rv = registry->AddKey(profilesTreeKey,
-                                    profileItem->profileName.get(),
-                                    &profKey);
-            if (NS_FAILED(rv)) return rv;
-
-            rv = registry->SetString(profKey,
-                                     kRegistryMigratedString.get(),
-                                     profileItem->isMigrated ? kRegistryYesString.get() : kRegistryNoString.get());
-            if (NS_FAILED(rv)) return rv;
-
-            registry->SetString(profKey,
-                                kRegistryNCProfileNameString.get(),
-                                profileItem->NCProfileName.get());
-
-            registry->SetString(profKey,
-                                kRegistryNCServiceDenialString.get(),
-                                profileItem->NCDeniedService.get());
-
-            registry->SetString(profKey,
-                                kRegistryNCUserEmailString.get(),
-                                profileItem->NCEmailAddress.get());
-
-            registry->SetString(profKey,
-                                kRegistryNCHavePREGInfoString.get(),
-                                profileItem->NCHavePregInfo.get());
-
-            registry->SetLongLong(profKey,
-                                  kRegistryCreationTimeString.get(),
-                                  &profileItem->creationTime);
-
-            registry->SetLongLong(profKey,
-                                  kRegistryLastModTimeString.get(),
-                                  &profileItem->lastModTime);
-
-            rv = profileItem->ExternalizeLocation(registry, profKey);
-            if (NS_FAILED(rv)) {
-                NS_ASSERTION(PR_FALSE, "Could not update profile location");
-                continue;
-            }
-            profileItem->ExternalizeMigratedFromLocation(registry, profKey);
-
-            profileItem->updateProfileEntry = PR_FALSE;
-        }
-    }
-
-    mProfileDataChanged = PR_FALSE;
-
-    return rv;
-}
-
-nsresult
-nsProfileAccess::GetOriginalProfileDir(const PRUnichar *profileName, nsILocalFile **originalDir)
-{
-    NS_ENSURE_ARG(profileName);
-    NS_ENSURE_ARG_POINTER(originalDir);
-    *originalDir = nsnull;
-    nsresult rv = NS_OK;
-
-    PRInt32 index = FindProfileIndex(profileName, PR_TRUE);
-    if (index >= 0)
-    {
-        ProfileStruct* profileItem = (ProfileStruct *) (mProfiles->ElementAt(index));
-        nsCOMPtr<nsILocalFile> profileDir;
-        rv = profileItem->GetResolvedProfileDir(getter_AddRefs(profileDir));
-        if (NS_SUCCEEDED(rv) && profileDir)
-        {
-#ifdef XP_MAC
-            PRBool exists;
-            rv = profileDir->Exists(&exists);
-            if (NS_FAILED(rv))
-                return rv;
-            if (exists) {
-                PRBool inTrash;
-                nsCOMPtr<nsIFile> trashFolder;
-
-                rv = NS_GetSpecialDirectory(NS_MAC_TRASH_DIR, getter_AddRefs(trashFolder));
-                if (NS_FAILED(rv)) return rv;
-                rv = trashFolder->Contains(profileDir, PR_TRUE, &inTrash);
-                if (NS_FAILED(rv)) return rv;
-                if (inTrash) {
-                    return NS_ERROR_FILE_NOT_FOUND;
-                }
-            }
-#endif
-            NS_IF_ADDREF(*originalDir = profileDir);
-        }
-        return rv;
-    }
-    return NS_ERROR_FAILURE;
-}
-
-nsresult
-nsProfileAccess::SetMigratedFromDir(const PRUnichar *profileName, nsILocalFile *originalDir)
-{
-    NS_ENSURE_ARG(profileName);
-    NS_ENSURE_ARG(originalDir);
-
-    PRInt32 index = FindProfileIndex(profileName, PR_FALSE);
-    if (index >= 0)
-    {
-        ProfileStruct* profileItem = (ProfileStruct *) (mProfiles->ElementAt(index));
-        profileItem->migratedFrom = originalDir;
-        profileItem->updateProfileEntry = PR_TRUE;
-        return NS_OK;
-    }
-    return NS_ERROR_FAILURE;
-}
-
-nsresult
-nsProfileAccess::SetProfileLastModTime(const PRUnichar *profileName, PRInt64 lastModTime)
-{
-    NS_ENSURE_ARG(profileName);
-
-    PRInt32 index = FindProfileIndex(profileName, PR_FALSE);
-    if (index >= 0)
-    {
-        ProfileStruct* profileItem = (ProfileStruct *) (mProfiles->ElementAt(index));
-        profileItem->lastModTime = lastModTime;
-        profileItem->updateProfileEntry = PR_TRUE;
-        return NS_OK;
-    }
-    return NS_ERROR_FAILURE;
-}
-
-nsresult
-nsProfileAccess::GetStartWithLastUsedProfile(PRBool *aStartWithLastUsedProfile)
-{
-    NS_ENSURE_ARG_POINTER(aStartWithLastUsedProfile);
-    *aStartWithLastUsedProfile = mStartWithLastProfile;
-    return NS_OK;
-}
-
-nsresult
-nsProfileAccess::SetStartWithLastUsedProfile(PRBool aStartWithLastUsedProfile)
-{
-    mStartWithLastProfile = aStartWithLastUsedProfile;
-    mProfileDataChanged = PR_TRUE;
-    return NS_OK;
-}
-
-// Return the list of profiles, 4x, 5x, or both.
-nsresult
-nsProfileAccess::GetProfileList(PRInt32 whichKind, PRUint32 *length, PRUnichar ***result)
-{
-    NS_ENSURE_ARG_POINTER(length);
-    *length = 0;
-    NS_ENSURE_ARG_POINTER(result);
-    *result = nsnull;
-
-    nsresult rv = NS_OK;
-    PRInt32 count, localLength = 0;
-    PRUnichar **outArray, **next;
-    PRInt32 numElems = mProfiles->Count();
-    PRInt32 profilesCount;
-
-    switch (whichKind)
-    {
-        case nsIProfileInternal::LIST_ONLY_NEW:
-            GetNumProfiles(&count);
-            break;
-        case nsIProfileInternal::LIST_ONLY_OLD:
-            GetNum4xProfiles(&count);
-            break;
-        case nsIProfileInternal::LIST_ALL:
-            GetNum4xProfiles(&count);
-            GetNumProfiles(&profilesCount);
-            count += profilesCount;
-            break;
-        case nsIProfileInternal::LIST_FOR_IMPORT:
-            GetNum4xProfiles(&count);
-            GetNumProfiles(&profilesCount);
-            count = numElems - (count + profilesCount);
-            break;
-        default:
-            NS_ASSERTION(PR_FALSE, "Bad parameter");
-            return NS_ERROR_INVALID_ARG;
-    }
-
-    next = outArray = (PRUnichar **)nsMemory::Alloc(count * sizeof(PRUnichar *));
-    if (!outArray)
-        return NS_ERROR_OUT_OF_MEMORY;
-
-    for (PRInt32 index=0; index < numElems && localLength < count; index++)
-    {
-        ProfileStruct* profileItem = (ProfileStruct *) (mProfiles->ElementAt(index));
-
-        if (whichKind == nsIProfileInternal::LIST_ONLY_OLD && (profileItem->isMigrated || profileItem->isImportType))
-            continue;
-        else if (whichKind == nsIProfileInternal::LIST_ONLY_NEW && (!profileItem->isMigrated || profileItem->isImportType))
-            continue;
-        else if (whichKind == nsIProfileInternal::LIST_ALL && profileItem->isImportType)
-            continue;
-        else if (whichKind == nsIProfileInternal::LIST_FOR_IMPORT && !profileItem->isImportType)
-            continue;
-        *next = ToNewUnicode(profileItem->profileName);
-        if (*next == nsnull)
-        {
-            rv = NS_ERROR_OUT_OF_MEMORY;
-            break;
-        }
-        next++;
-        localLength++;
-    }
-
-    if (NS_SUCCEEDED(rv))
-    {
-        *result = outArray;
-        *length = localLength;
-    }
-    else
-    {
-        while (--next >= outArray)
-            nsMemory::Free(*next);
-        nsMemory::Free(outArray);
-    }
-
-    return rv;
-}
-
-// Return a boolean based on the profile existence.
-PRBool
-nsProfileAccess::ProfileExists(const PRUnichar *profileName)
-{
-    NS_ASSERTION(profileName, "Invalid profile name");
-
-    PRBool exists = PR_FALSE;
-    PRInt32 numElems = mProfiles->Count();
-
-    for (PRInt32 index=0; index < numElems; index++)
-    {
-        ProfileStruct* profileItem = (ProfileStruct *) (mProfiles->ElementAt(index));
-        if (!profileItem->isImportType && profileItem->profileName.Equals(profileName))
-        {
-            exists = PR_TRUE;
-            break;
-        }
-    }
-    return exists;
-}
-
-// Capture the 4x profile information from the old registry (4x)
-nsresult
-nsProfileAccess::Get4xProfileInfo(nsIFile *registryFile, PRBool fromImport)
-{
-    nsresult rv = NS_OK;
-    if (fromImport && m4xProfilesAdded)
-        return rv;
-
-#if defined(XP_WIN) || defined(XP_OS2) || defined(XP_MAC) || defined(XP_MACOSX)
-    NS_ENSURE_ARG(registryFile);
-
-    nsCOMPtr<nsIRegistry> oldReg(do_CreateInstance(NS_REGISTRY_CONTRACTID, &rv));
-    if (NS_FAILED(rv)) return rv;
-    rv = oldReg->Open(registryFile);
-    if (NS_FAILED(rv)) return rv;
-
-    // Enumerate 4x tree and create an array of that information.
-    // Enumerate all subkeys (immediately) under the given node.
-    nsCOMPtr<nsIEnumerator> enumKeys;
-
-    rv = oldReg->EnumerateSubtrees(nsIRegistry::Users,
-                                   getter_AddRefs(enumKeys));
-    if (NS_FAILED(rv)) return rv;
-
-    rv = enumKeys->First();
-    if (NS_FAILED(rv)) return rv;
-
-    if (fromImport)
-        m4xProfilesAdded = PR_TRUE;
-    // Enumerate subkeys till done.
-    while( (NS_OK != enumKeys->IsDone()))
-    {
-        nsCOMPtr<nsISupports> base;
-        rv = enumKeys->CurrentItem(getter_AddRefs(base));
-        if (NS_FAILED(rv)) return rv;
-
-        // Get specific interface.
-        nsCOMPtr <nsIRegistryNode> node;
-        nsIID nodeIID = NS_IREGISTRYNODE_IID;
-        rv = base->QueryInterface( nodeIID, getter_AddRefs(node));
-        if (NS_FAILED(rv)) return rv;
-
-        nsXPIDLString profile;
-        rv = node->GetName(getter_Copies(profile));
-        if (NS_FAILED(rv)) return rv;
-
-        // Unescape is done on the profileName to interpret special characters like %, _ etc.
-        // For example something like %20 would probably be interpreted as a space
-        // There is some problem I guess in sending a space as itself
-        // NOTE: This needs to be done BEFORE the test for existence.
-
-#if defined(XP_MAC) || defined(XP_MACOSX)
-        // 4.x profiles coming from japanese machine are already in unicode.
-        // So, there is no need to decode into unicode further.
-        NS_ConvertUTF16toUTF8 temp(profile);
-        nsCAutoString profileName(nsUnescape(temp.BeginWriting()));
-        NS_ConvertUTF8toUTF16 convertedProfName(profileName);
-#else
-        nsCAutoString temp;
-        NS_CopyUnicodeToNative(profile, temp);
-        nsCAutoString profileName(nsUnescape(temp.BeginWriting()));
-        nsAutoString convertedProfName;
-        NS_CopyNativeToUnicode(profileName, convertedProfName);
-#endif
-
-        PRBool exists = PR_FALSE;
-        if (!fromImport) {
-            exists = ProfileExists(convertedProfName.get());
-            if (exists)
-            {
-                rv = enumKeys->Next();
-                if (NS_FAILED(rv)) return rv;
-                continue;
-            }
-        }
-
-        nsRegistryKey key;
-        rv = node->GetKey(&key);
-        if (NS_FAILED(rv)) return rv;
-
-        ProfileStruct*  profileItem  = new ProfileStruct();
-        if (!profileItem)
-            return NS_ERROR_OUT_OF_MEMORY;
-
-        profileItem->updateProfileEntry    = PR_TRUE;
-        profileItem->profileName  = convertedProfName;
-        rv = profileItem->InternalizeLocation(oldReg, key, PR_TRUE);
-        NS_ASSERTION(NS_SUCCEEDED(rv), "Could not get 4x profile location");
-        profileItem->isMigrated = PR_FALSE;
-        profileItem->isImportType = fromImport;
-
-        SetValue(profileItem);
-        delete profileItem;
-
-        rv = enumKeys->Next();
-        if (NS_FAILED(rv)) return rv;
-    }
-
-#elif defined (XP_BEOS)
-#else
-/* XP_UNIX */
-        nsCAutoString unixProfileName( PR_GetEnv(PROFILE_NAME_ENVIRONMENT_VARIABLE) );
-        nsCAutoString unixProfileDirectory( PR_GetEnv(PROFILE_HOME_ENVIRONMENT_VARIABLE) );
-
-        if (unixProfileName.IsEmpty()  ||
-            unixProfileDirectory.IsEmpty())
-        {
-            unixProfileDirectory = PR_GetEnv(HOME_ENVIRONMENT_VARIABLE);
-            unixProfileName = PR_GetEnv(LOGNAME_ENVIRONMENT_VARIABLE);
-            if ( unixProfileName.IsEmpty() ) {
-              unixProfileName = PR_GetEnv(USER_ENVIRONMENT_VARIABLE);
-            }
-            if ( unixProfileName.IsEmpty() ) {
-              unixProfileName = DEFAULT_UNIX_PROFILE_NAME;
-            }
-        }
-
-        PRBool exists = PR_FALSE;
-        if (!fromImport) {
-            nsAutoString profileNameUTF16;
-            NS_CopyNativeToUnicode(unixProfileName, profileNameUTF16);
-            exists = ProfileExists(profileNameUTF16.get());
-            if (exists)
-            {
-                return NS_OK;
-            }
-        }
-        if ( ! unixProfileName.IsEmpty() && ! unixProfileDirectory.IsEmpty() ) {
-            nsCAutoString profileLocation(unixProfileDirectory);
-            profileLocation += "/.netscape";
-
-            nsCOMPtr<nsILocalFile> fileInNSDir;
-            rv = NS_NewNativeLocalFile(profileLocation + NS_LITERAL_CSTRING("/preferences.js"),
-                                       PR_TRUE,
-                                       getter_AddRefs(fileInNSDir));
-            if (NS_FAILED(rv))
-              return rv;
-            rv = fileInNSDir->Exists(&exists);
-#ifdef DEBUG
-            printf("%s/preferences.js exists:  %d\n",profileLocation.get(), NS_SUCCEEDED(rv) && exists);
-#endif
-            if (NS_SUCCEEDED(rv) && exists) {
-                ProfileStruct*  profileItem     = new ProfileStruct();
-                if (!profileItem)
-                    return NS_ERROR_OUT_OF_MEMORY;
-
-                profileItem->updateProfileEntry = PR_TRUE;
-
-                NS_CopyNativeToUnicode(unixProfileName, profileItem->profileName);
-
-                nsCOMPtr<nsILocalFile> localFile;
-                rv = NS_NewNativeLocalFile(profileLocation, PR_TRUE, getter_AddRefs(localFile));
-                if (NS_FAILED(rv)) return rv;
-                profileItem->SetResolvedProfileDir(localFile);
-                profileItem->isMigrated = PR_FALSE;
-                profileItem->isImportType = fromImport;
-
-                SetValue(profileItem);
-                delete profileItem;
-            }
-            else {
-#ifdef DEBUG
-                printf("no 4.x profile\n");
-#endif
-            }
-        }
-#endif /* XP_UNIX */
-
-    return rv;
-}
-
-
-// Set the PREG flag to indicate if that info exists
-void
-nsProfileAccess::SetPREGInfo(const char* pregInfo)
-{
-    NS_ASSERTION(pregInfo, "Invalid pregInfo");
-
-    // This is always going to be just a yes/no string
-    mHavePREGInfo.AssignWithConversion(pregInfo);
-}
-
-//Get the for PREG info.
-void
-nsProfileAccess::CheckRegString(const PRUnichar *profileName, char **info)
-{
-    NS_ASSERTION(profileName, "Invalid profile name");
-    NS_ASSERTION(info, "Invalid info pointer");
-
-    *info = nsnull;
-    PRInt32 index = 0;
-
-    index = FindProfileIndex(profileName, PR_FALSE);
-
-    if (index >= 0 )
-    {
-        ProfileStruct* profileItem = (ProfileStruct *) (mProfiles->ElementAt(index));
-
-        if (!profileItem->NCHavePregInfo.IsEmpty()) {
-            *info = ToNewCString(profileItem->NCHavePregInfo);
-        }
-        else
-        {
-            *info = ToNewCString(kRegistryNoString);
-        }
-    }
-}
-
-
-// Clear the profile member data structure
-// We need to fill in the data from the new registry
-nsresult
-nsProfileAccess::ResetProfileMembers()
-{
-    FreeProfileMembers(mProfiles);
-    mProfiles = new nsVoidArray();
-    return NS_OK;
-}
-
-nsresult
-nsProfileAccess::DetermineForceMigration(PRBool *forceMigration)
-{
-    if (!forceMigration) return NS_ERROR_NULL_POINTER;
-
-    PRInt32 numProfiles;
-    GetNumProfiles(&numProfiles);
-
-    if (numProfiles > 0) {
-        // we have some 6.0 profiles, don't force migration:
-        *forceMigration = PR_FALSE;
-            return NS_OK;
-    }
-
-    // even if we don't any 4.x profiles, running -installer is safe.  so do it
-    *forceMigration = PR_TRUE;
-    return NS_OK;
-}
-
-// **********************************************************************
-// class ProfileStruct
-// **********************************************************************
-
-ProfileStruct::ProfileStruct() :
-    isMigrated(PR_FALSE), updateProfileEntry(PR_FALSE),
-    isImportType(PR_FALSE),
-    creationTime(LL_ZERO), lastModTime(LL_ZERO)
-{
-}
-
-ProfileStruct::ProfileStruct(const ProfileStruct& src)
-{
-    *this = src;
-}
-
-ProfileStruct& ProfileStruct::operator=(const ProfileStruct& rhs)
-{
-    profileName = rhs.profileName;
-    isMigrated = rhs.isMigrated;
-    NCProfileName = rhs.NCProfileName;
-    NCDeniedService = rhs.NCDeniedService;
-    NCEmailAddress = rhs.NCEmailAddress;
-    NCHavePregInfo = rhs.NCHavePregInfo;
-    updateProfileEntry = rhs.updateProfileEntry;
-    isImportType = rhs.isImportType;
-    creationTime = rhs.creationTime;
-    lastModTime = rhs.lastModTime;
-
-    nsresult rv;
-        nsCOMPtr<nsIFile> file;
-
-    resolvedLocation = nsnull;
-    if (rhs.resolvedLocation) {
-        regLocationData.Truncate(0);
-        rv = rhs.resolvedLocation->Clone(getter_AddRefs(file));
-        if (NS_SUCCEEDED(rv))
-            resolvedLocation = do_QueryInterface(file);
-        file = nsnull;
-    }
-    else
-        regLocationData = rhs.regLocationData;
-
-    migratedFrom = nsnull;
-    if (rhs.migratedFrom) {
-        rv = rhs.migratedFrom->Clone(getter_AddRefs(file));
-        if (NS_SUCCEEDED(rv))
-            migratedFrom = do_QueryInterface(file);
-    }
-
-    return *this;
-}
-
-nsresult ProfileStruct::GetResolvedProfileDir(nsILocalFile **aDirectory)
-{
-    NS_ENSURE_ARG_POINTER(aDirectory);
-    *aDirectory = nsnull;
-    if (resolvedLocation)
-    {
-        *aDirectory = resolvedLocation;
-        NS_ADDREF(*aDirectory);
-        return NS_OK;
-    }
-    return NS_ERROR_FILE_NOT_FOUND; // The only reason it would not exist.
-}
-
-nsresult ProfileStruct::SetResolvedProfileDir(nsILocalFile *aDirectory)
-{
-    NS_ENSURE_ARG(aDirectory);
-    resolvedLocation = aDirectory;
-    regLocationData.SetLength(0);
-    return NS_OK;
-}
-
-nsresult ProfileStruct::CopyProfileLocation(ProfileStruct *destStruct)
-{
-    if (resolvedLocation)
-    {
-        nsCOMPtr<nsIFile> file;
-        nsresult rv = resolvedLocation->Clone(getter_AddRefs(file));
-        if (NS_SUCCEEDED(rv))
-            destStruct->resolvedLocation = do_QueryInterface(file, &rv);
-        if (NS_FAILED(rv)) return rv;
-    }
-    destStruct->regLocationData = regLocationData;
-
-    return NS_OK;
-}
-
-nsresult ProfileStruct::InternalizeLocation(nsIRegistry *aRegistry, nsRegistryKey profKey, PRBool is4x)
-{
-    nsresult rv;
-    nsCOMPtr<nsILocalFile> tempLocal;
-
-    // Reset ourselves
-    regLocationData.SetLength(0);
-    resolvedLocation = nsnull;
-
-    if (is4x)
-    {
-        nsXPIDLString profLoc;
-
-        rv = aRegistry->GetString( profKey, NS_LITERAL_STRING("ProfileLocation").get(), getter_Copies(profLoc));
-        if (NS_FAILED(rv)) return rv;
-        regLocationData = profLoc;
-
-#if defined(XP_MAC) || defined(XP_MACOSX)
-        // 4.x profiles coming from japanese machine are already in unicode.
-        // So, there is no need to decode into unicode further.
-
-        // Unescape profile location
-        NS_ConvertUTF16toUTF8 tempLoc(profLoc);
-        nsCAutoString profileLocation(nsUnescape(tempLoc.BeginWriting()));
-        NS_ConvertUTF8toUTF16 convertedProfLoc(profileLocation);
-
-        // Now we have a unicode path - make it into a file
-        // This is an HFS style path, which can't be used with nsIFile, so convert it.
-        rv = NS_ERROR_FAILURE;
-        CFStringRef pathStrRef = ::CFStringCreateWithCharacters(NULL,
-                                      convertedProfLoc.get(), convertedProfLoc.Length());
-        if (pathStrRef)
-        {
-            CFURLRef pathURLRef = ::CFURLCreateWithFileSystemPath(NULL, pathStrRef, kCFURLHFSPathStyle, true);
-            if (pathURLRef)
-            {
-                rv = NS_NewNativeLocalFile(EmptyCString(), PR_TRUE, getter_AddRefs(tempLocal));
-                if (NS_SUCCEEDED(rv))
-                {
-                    nsCOMPtr<nsILocalFileMac> tempLocalMac(do_QueryInterface(tempLocal));
-                    rv = tempLocalMac->InitWithCFURL(pathURLRef);
-                }
-                ::CFRelease(pathURLRef);
-            }
-            ::CFRelease(pathStrRef);
-        }
-#else        
-        // Unescape profile location and convert it to the right format
-        nsCAutoString tempLoc;
-        rv = NS_CopyUnicodeToNative(profLoc, tempLoc); 
-        NS_ASSERTION(NS_SUCCEEDED(rv), 
-                     "failed to convert profile location to native encoding");
-        nsCAutoString profileLocation(nsUnescape(tempLoc.BeginWriting()));
-        rv = NS_NewNativeLocalFile(profileLocation, PR_TRUE, getter_AddRefs(tempLocal));
-#endif
-    }
-    else
-    {
-        nsXPIDLString regData;
-
-        rv = aRegistry->GetString(profKey,
-                                  kRegistryDirectoryString.get(),
-                                  getter_Copies(regData));
-        if (NS_FAILED(rv)) return rv;
-        regLocationData = regData;
-
-#if defined(XP_MAC) || defined(XP_MACOSX)
-            rv = NS_NewNativeLocalFile(EmptyCString(), PR_TRUE, getter_AddRefs(tempLocal));
-        if (NS_SUCCEEDED(rv)) // regLocationData is ASCII so no loss
-            rv = tempLocal->SetPersistentDescriptor(NS_LossyConvertUTF16toASCII(regLocationData));
-#else
-        rv = NS_NewLocalFile(regLocationData, PR_TRUE, getter_AddRefs(tempLocal));
-#endif
-    }
-
-    if (NS_SUCCEEDED(rv) && tempLocal)
-    {
-        PRBool exists;
-        if (NS_SUCCEEDED(tempLocal->Exists(&exists)) && exists)
-            SetResolvedProfileDir(tempLocal);
-    }
-
-    return NS_OK;
-}
-
-nsresult ProfileStruct::ExternalizeLocation(nsIRegistry *aRegistry, nsRegistryKey profKey)
-{
-    nsresult rv;
-
-    if (resolvedLocation)
-    {
-        nsAutoString regData;
-
-#if defined(XP_MAC) || defined(XP_MACOSX)
-        PRBool leafCreated;
-        nsCAutoString descBuf;
-
-        // It must exist before we try to use GetPersistentDescriptor
-        rv = EnsureDirPathExists(resolvedLocation, &leafCreated);
-        if (NS_FAILED(rv)) return rv;
-        rv = resolvedLocation->GetPersistentDescriptor(descBuf);
-        if (NS_FAILED(rv)) return rv;
-        if (leafCreated)
-            resolvedLocation->Remove(PR_FALSE);
-        AppendUTF8toUTF16(descBuf, regData);
-#else
-        rv = resolvedLocation->GetPath(regData);
-        if (NS_FAILED(rv)) return rv;
-#endif
-
-        rv = aRegistry->SetString(profKey,
-                                 kRegistryDirectoryString.get(),
-                                 regData.get());
-
-    }
-    else if (!regLocationData.IsEmpty())
-    {
-        // Write the original data back out - maybe it can be resolved later.
-        rv = aRegistry->SetString(profKey,
-                                 kRegistryDirectoryString.get(),
-                                 regLocationData.get());
-    }
-    else
-    {
-        NS_ASSERTION(PR_FALSE, "ProfileStruct has no location data!");
-        rv = NS_ERROR_FAILURE;
-    }
-
-    return rv;
-}
-
-nsresult ProfileStruct::InternalizeMigratedFromLocation(nsIRegistry *aRegistry, nsRegistryKey profKey)
-{
-    nsresult rv;
-    nsXPIDLCString regData;
-    nsCOMPtr<nsILocalFile> tempLocal;
-
-    rv = aRegistry->GetStringUTF8(profKey,
-                                  kRegistryMigratedFromString.get(),
-                                  getter_Copies(regData));
-    if (NS_SUCCEEDED(rv))
-    {
-#if defined(XP_MAC) || defined(XP_MACOSX)
-        rv = NS_NewLocalFile(EmptyString(), PR_TRUE, getter_AddRefs(tempLocal));
-        if (NS_SUCCEEDED(rv))
-        {
-            // The persistent desc on Mac is base64 encoded so plain ASCII
-            rv = tempLocal->SetPersistentDescriptor(regData);
-            if (NS_SUCCEEDED(rv))
-                migratedFrom = tempLocal;
-        }
-#else
-        rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(regData), PR_TRUE, getter_AddRefs(tempLocal));
-        if (NS_SUCCEEDED(rv))
-            migratedFrom = tempLocal;
-#endif
-    }
-    return rv;
-}
-
-nsresult ProfileStruct::ExternalizeMigratedFromLocation(nsIRegistry *aRegistry, nsRegistryKey profKey)
-{
-    nsresult rv = NS_OK;
-    nsCAutoString regData;
-
-    if (migratedFrom)
-    {
-#if defined(XP_MAC) || defined(XP_MACOSX)
-        rv = migratedFrom->GetPersistentDescriptor(regData);
-#else
-        nsAutoString path;
-        rv = migratedFrom->GetPath(path);
-        AppendUTF16toUTF8(path, regData);
-#endif
-
-        if (NS_SUCCEEDED(rv))
-            rv = aRegistry->SetStringUTF8(profKey,
-                                          kRegistryMigratedFromString.get(),
-                                          regData.get());
-    }
-    return rv;
-}
-
-nsresult ProfileStruct::EnsureDirPathExists(nsILocalFile *aDir, PRBool *wasCreated)
-{
-    NS_ENSURE_ARG(aDir);
-    NS_ENSURE_ARG_POINTER(wasCreated);
-    *wasCreated = PR_FALSE;
-
-    nsresult rv;
-    PRBool exists;
-    rv = aDir->Exists(&exists);
-    if (NS_SUCCEEDED(rv) && !exists)
-    {
-        rv = aDir->Create(nsIFile::DIRECTORY_TYPE, 0700);
-        *wasCreated = NS_SUCCEEDED(rv);
-    }
-    return rv;
-}
-
deleted file mode 100644
--- a/profile/src/nsProfileAccess.h
+++ /dev/null
@@ -1,200 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org Code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * 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 __nsProfileAccess_h___
-#define __nsProfileAccess_h___
-
-#include "nsCOMPtr.h"
-#include "nsISupports.h"
-#include "nsString.h"
-#include "nsIRegistry.h"
-#include "nsXPIDLString.h"
-#include "nsVoidArray.h"
-#include "nsIFile.h"
-#include "nsILocalFile.h"
-
-#ifdef XP_WIN
-#include <windows.h>
-#endif
-
-#ifdef XP_OS2
-#define INCL_DOSERRORS
-#define INCL_DOSFILEMGR
-#include <os2.h>
-#endif
-
-class ProfileStruct
-{    
-public:
-     ProfileStruct();
-     ProfileStruct(const ProfileStruct& src);
-                
-    ~ProfileStruct() { }
-    
-     ProfileStruct& operator=(const ProfileStruct& rhs);
-    
-    /*
-     * GetResolvedProfileDir returns the directory specified in the
-     * registry. It will return NULL if the spec in the registry
-     * could not be resolved to a path. This directory does not
-     * nescesarily exist, although it can be created (i.e. the path
-     * is not on an unmounted drive or something).
-     */            
-    nsresult    GetResolvedProfileDir(nsILocalFile **aDirectory);
-    
-    /*
-     * SetResolvedProfileDir will update the directory in the profile
-     * entry. The next time this entry is externalized, this directory
-     * will replace the existing entry in the registry.
-     */
-    nsresult    SetResolvedProfileDir(nsILocalFile *aDirectory);
-    
-    /*
-     * Copies private members to another ProfileStruct
-     */
-    nsresult    CopyProfileLocation(ProfileStruct *destStruct);
-    
-    /*
-     * Methods used by routines which internalize
-     * and externalize profile info.
-     */
-    nsresult    InternalizeLocation(nsIRegistry *aRegistry, nsRegistryKey profKey, PRBool is4x);
-    nsresult    ExternalizeLocation(nsIRegistry *aRegistry, nsRegistryKey profKey);
-    nsresult    InternalizeMigratedFromLocation(nsIRegistry *aRegistry, nsRegistryKey profKey);
-    nsresult    ExternalizeMigratedFromLocation(nsIRegistry *aRegistry, nsRegistryKey profKey);
-    
-public:
-    nsString    profileName;
-    PRBool      isMigrated;
-
-    // The directory from which this profile was migrated from (if any)
-    // Added in mozilla1.0.1 and maintained in the registry
-    nsCOMPtr<nsILocalFile> migratedFrom;
-
-    nsString    NCProfileName;
-    nsString    NCDeniedService;
-    nsString    NCEmailAddress;
-    nsString    NCHavePregInfo;
-    PRBool      updateProfileEntry;
-    // this flag detemines if we added this profile to the list for the import module.
-    PRBool      isImportType; 
-    // These fields were added in mozilla1.0.1 and maintained in the registry.
-    // Values are in milliseconds since midnight Jan 1, 1970 GMT (same as nsIFile)
-    // Their values will be LL_ZERO if undefined.
-    PRInt64     creationTime;
-    PRInt64     lastModTime; 
-
-private:
-    nsresult    EnsureDirPathExists(nsILocalFile *aFile, PRBool *wasCreated);
-    
-private:
-    // These are mutually exclusive - We have one or the other.    
-    nsString regLocationData;
-    nsCOMPtr<nsILocalFile> resolvedLocation;
-};
-
-
-class nsProfileAccess
-{
-
-private:
-    nsCOMPtr <nsIFile> mNewRegFile;
-
-    // This is an array that holds all the profile information--migrated/unmigrated
-    // unmigrated: if the profileinfo is migrated--i.e. -installer option is used
-    nsVoidArray*  mProfiles;
-
-    nsString      mCurrentProfile;
-    nsString      mHavePREGInfo;
-    PRBool        m4xProfilesAdded;
-    PRBool        mStartWithLastProfile;
-public:
-    PRBool        mProfileDataChanged;
-    PRBool        mForgetProfileCalled;
-
-public:
-
-    nsProfileAccess();
-    virtual ~nsProfileAccess();
-
-    void GetNumProfiles(PRInt32 *numProfiles);
-    void GetNum4xProfiles(PRInt32 *numProfiles);
-    void GetFirstProfile(PRUnichar **firstProfile);
-    nsresult GetProfileList(PRInt32 whichKind, PRUint32 *length, PRUnichar ***result);
-    nsresult GetOriginalProfileDir(const PRUnichar *profileName, nsILocalFile **orginalDir);
-    nsresult SetMigratedFromDir(const PRUnichar *profileName, nsILocalFile *orginalDir);
-    nsresult SetProfileLastModTime(const PRUnichar *profileName, PRInt64 lastModTime);
-    nsresult GetStartWithLastUsedProfile(PRBool *aStartWithLastUsedProfile);
-    nsresult SetStartWithLastUsedProfile(PRBool aStartWithLastUsedProfile);
-    
-    // if fromImport is true all the 4.x profiles will be added to mProfiles with the isImportType flag set.
-    // pass fromImport as True only if you are calling from the Import Module.
-    nsresult Get4xProfileInfo(nsIFile *registryFile, PRBool fromImport);
-
-    void SetCurrentProfile(const PRUnichar *profileName);
-    void GetCurrentProfile(PRUnichar **profileName);
-    
-    nsresult GetValue(const PRUnichar* profileName, ProfileStruct** aProfile);
-    nsresult SetValue(ProfileStruct* aProfile);
-    void CheckRegString(const PRUnichar *profileName, char** regString);
-    void RemoveSubTree(const PRUnichar* profileName);
-
-    PRBool ProfileExists(const PRUnichar *profileName);
-
-    nsresult DetermineForceMigration(PRBool *forceMigration);
-    nsresult UpdateRegistry(nsIFile* regName);
-
-private:
-    nsresult FillProfileInfo(nsIFile* regName);
-
-
-
-    nsresult HavePregInfo(char **info);
-
-    // if forImport is true searches only the ImportType profiles
-    // else searches the non-ImportType profiles.
-    PRInt32	 FindProfileIndex(const PRUnichar* profileName, PRBool forImport);
-
-    void SetPREGInfo(const char* pregInfo);
-    void FreeProfileMembers(nsVoidArray *aProfile);
-    nsresult ResetProfileMembers();
-};
-
-
-#endif // __nsProfileAccess_h___
-
--- a/toolkit/xre/nsNativeAppSupportOS2.cpp
+++ b/toolkit/xre/nsNativeAppSupportOS2.cpp
@@ -66,17 +66,16 @@
 #include "nsISupportsPrimitives.h"
 #include "nsISupportsArray.h"
 #include "nsIWindowWatcher.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIBaseWindow.h"
 #include "nsIWidget.h"
 #include "nsIAppShellService.h"
-#include "nsIProfileInternal.h"
 #include "nsIXULWindow.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIPromptService.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsIObserver.h"
 #include "nsIObserverService.h"
--- a/toolkit/xre/nsNativeAppSupportWin.cpp
+++ b/toolkit/xre/nsNativeAppSupportWin.cpp
@@ -54,17 +54,16 @@
 #include "nsISupportsArray.h"
 #include "nsIWindowWatcher.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIBaseWindow.h"
 #include "nsIWidget.h"
 #include "nsIAppShellService.h"
-#include "nsIProfileInternal.h"
 #include "nsIXULWindow.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIPromptService.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsIObserver.h"
 #include "nsIObserverService.h"