Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
nsProfile.cpp File Reference
#include "nscore.h"
#include "nsProfile.h"
#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"
#include "nsIDocShell.h"
#include "nsIWebBrowserChrome.h"
#include "nsIScriptGlobalObject.h"
#include "nsIScriptContext.h"
#include "nsIBaseWindow.h"
#include "nsIDialogParamBlock.h"
#include "nsIDOMWindowInternal.h"
#include "nsIWindowWatcher.h"
#include "jsapi.h"
#include "nsIJSContextStack.h"
#include "nsEmbedCID.h"

Go to the source code of this file.

Defines

#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"
#define CHROME_STYLE   nsIWebBrowserChrome::CHROME_ALL | nsIWebBrowserChrome::CHROME_CENTER_SCREEN
#define NS_SESSIONROAMING_CONTRACTID   "@mozilla.org/profile/session-roaming;1"
#define SALT_SIZE   8
#define TABLE_SIZE   36
#define kSaltExtensionCString_Len   PRUint32(sizeof(kSaltExtensionCString)-1)

Functions

static NS_DEFINE_CID (kPrefMigrationCID, NS_PREFMIGRATION_CID)
static NS_DEFINE_CID (kPrefConverterCID, NS_PREFCONVERTER_CID)
static nsresult RecursiveCopy (nsIFile *srcDir, nsIFile *destDir)

Variables

const char * kDefaultOpenWindowParams = "centerscreen,chrome,modal,titlebar"
const char * kBrandBundleURL = "chrome://branding/locale/brand.properties"
const char * kMigrationBundleURL = "chrome://communicator/locale/profile/migration.properties"
static nsProfileAccessgProfileDataAccess = nsnull
static PRInt32 gInstanceCount = 0
static nsHashtable * gLocaleProfiles = nsnull
static
nsProfileDirServiceProvider
gDirServiceProvider = nsnull
static const char kSaltExtensionCString [] = ".slt"
static const char table []

Define Documentation

Definition at line 133 of file nsProfile.cpp.

#define CONTENTLOCALE_CMD_LINE_ARG   "-contentLocale"

Definition at line 122 of file nsProfile.cpp.

#define CREATE_PROFILE_CMD_LINE_ARG   "-CreateProfile"

Definition at line 119 of file nsProfile.cpp.

#define DEFAULT_PROFILE_NAME   (NS_LITERAL_STRING("default").get())

Definition at line 110 of file nsProfile.cpp.

#define INSTALLER_CMD_LINE_ARG   "-installer"

Definition at line 118 of file nsProfile.cpp.

Definition at line 1384 of file nsProfile.cpp.

#define NS_SESSIONROAMING_CONTRACTID   "@mozilla.org/profile/session-roaming;1"

Definition at line 165 of file nsProfile.cpp.

#define PREF_AUTOMIGRATION   "profile.allow_automigration"

Definition at line 125 of file nsProfile.cpp.

#define PREF_CONFIRM_AUTOMIGRATION   "profile.confirm_automigration"

Definition at line 124 of file nsProfile.cpp.

#define PREF_MIGRATE_ALL   "profile.migrate_all"

Definition at line 126 of file nsProfile.cpp.

#define PREF_MIGRATION_BEHAVIOR   "profile.migration_behavior"

Definition at line 127 of file nsProfile.cpp.

#define PREF_MIGRATION_DIRECTORY   "profile.migration_directory"

Definition at line 128 of file nsProfile.cpp.

Definition at line 120 of file nsProfile.cpp.

#define PROFILE_MANAGER_CMD_LINE_ARG   "-ProfileManager"

Definition at line 115 of file nsProfile.cpp.

#define PROFILE_MANAGER_URL   "chrome://communicator/content/profile/profileSelection.xul?manage=true"

Definition at line 114 of file nsProfile.cpp.

#define PROFILE_SELECTION_CMD_LINE_ARG   "-SelectProfile"

Definition at line 113 of file nsProfile.cpp.

#define PROFILE_SELECTION_URL   "chrome://communicator/content/profile/profileSelection.xul"

Definition at line 112 of file nsProfile.cpp.

#define PROFILE_WIZARD_CMD_LINE_ARG   "-ProfileWizard"

Definition at line 117 of file nsProfile.cpp.

#define PROFILE_WIZARD_URL   "chrome://communicator/content/profile/createProfileWizard.xul"

Definition at line 116 of file nsProfile.cpp.

#define SALT_SIZE   8

Definition at line 1380 of file nsProfile.cpp.

#define TABLE_SIZE   36

Definition at line 1381 of file nsProfile.cpp.

#define UILOCALE_CMD_LINE_ARG   "-UILocale"

Definition at line 121 of file nsProfile.cpp.


Function Documentation

static NS_DEFINE_CID ( kPrefMigrationCID  ,
NS_PREFMIGRATION_CID   
) [static]
static NS_DEFINE_CID ( kPrefConverterCID  ,
NS_PREFCONVERTER_CID   
) [static]
static nsresult RecursiveCopy ( nsIFile srcDir,
nsIFile destDir 
) [static]

Definition at line 174 of file nsProfile.cpp.

{
    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;
}

Here is the call graph for this function:


Variable Documentation

Definition at line 159 of file nsProfile.cpp.

PRInt32 gInstanceCount = 0 [static]

Definition at line 154 of file nsProfile.cpp.

nsHashtable* gLocaleProfiles = nsnull [static]

Definition at line 158 of file nsProfile.cpp.

Definition at line 153 of file nsProfile.cpp.

const char* kBrandBundleURL = "chrome://branding/locale/brand.properties"

Definition at line 138 of file nsProfile.cpp.

const char* kDefaultOpenWindowParams = "centerscreen,chrome,modal,titlebar"

Definition at line 136 of file nsProfile.cpp.

const char* kMigrationBundleURL = "chrome://communicator/locale/profile/migration.properties"

Definition at line 139 of file nsProfile.cpp.

const char kSaltExtensionCString[] = ".slt" [static]

Definition at line 1383 of file nsProfile.cpp.

const char table[] [static]
Initial value:
 
       { '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'}

Definition at line 1386 of file nsProfile.cpp.