nsSafariProfileMigrator.cpp File Reference
#include "nsAppDirectoryServiceDefs.h"
#include "nsBrowserProfileMigratorUtils.h"
#include "nsDirectoryServiceDefs.h"
#include "nsDirectoryServiceUtils.h"
#include "nsDocShellCID.h"
#include "nsINavBookmarksService.h"
#include "nsBrowserCompsCID.h"
#include "nsIBrowserHistory.h"
#include "nsICookieManager2.h"
#include "nsIFileProtocolHandler.h"
#include "nsIFormHistory.h"
#include "nsIIOService.h"
#include "nsILocalFileMac.h"
#include "nsIObserverService.h"
#include "nsIPrefService.h"
#include "nsIProfileMigrator.h"
#include "nsIProtocolHandler.h"
#include "nsIRDFContainer.h"
#include "nsIRDFDataSource.h"
#include "nsIRDFRemoteDataSource.h"
#include "nsIRDFService.h"
#include "nsIServiceManager.h"
#include "nsIStringBundle.h"
#include "nsISupportsArray.h"
#include "nsISupportsPrimitives.h"
#include "nsSafariProfileMigrator.h"
#include "nsToolkitCompsCID.h"
#include "nsNetUtil.h"
#include "nsTArray.h"
#include <Carbon/Carbon.h>
Include dependency graph for nsSafariProfileMigrator.cpp:

Go to the source code of this file.

Classes

struct  charsetEntry
 

Macros

#define SAFARI_PREFERENCES_FILE_NAME   NS_LITERAL_STRING("com.apple.Safari.plist")
 
#define SAFARI_BOOKMARKS_FILE_NAME   NS_LITERAL_STRING("Bookmarks.plist")
 
#define SAFARI_HISTORY_FILE_NAME   NS_LITERAL_STRING("History.plist")
 
#define SAFARI_COOKIES_FILE_NAME   NS_LITERAL_STRING("Cookies.plist")
 
#define SAFARI_COOKIE_BEHAVIOR_FILE_NAME   NS_LITERAL_STRING("com.apple.WebFoundation.plist")
 
#define SAFARI_DATE_OFFSET   978307200
 
#define SAFARI_HOME_PAGE_PREF   "HomePage"
 
#define MIGRATION_BUNDLE   "chrome://browser/locale/migration/migration.properties"
 
#define _SPM(type)   nsSafariProfileMigrator::type
 
#define CHARSET_ENTRY(charsetLabel, associatedLangGroup)   {#charsetLabel, sizeof(#charsetLabel) - 1, #charsetLabel, #associatedLangGroup}
 
#define CHARSET_ENTRY2(webkitLabel, mozLabel, associatedLangGroup)   {#webkitLabel, sizeof(#webkitLabel) - 1, #mozLabel, #associatedLangGroup}
 

Functions

CFPropertyListRef CopyPListFromFile (nsILocalFile *aPListFile)
 
CFDictionaryRef CopySafariPrefs ()
 
char * GetNullTerminatedString (CFStringRef aStringRef)
 
void FreeNullTerminatedString (char *aString)
 
PRBool GetDictionaryStringValue (CFDictionaryRef aDictionary, CFStringRef aKey, nsAString &aResult)
 
PRBool GetDictionaryCStringValue (CFDictionaryRef aDictionary, CFStringRef aKey, nsACString &aResult, CFStringEncoding aEncoding)
 
PRBool GetArrayStringValue (CFArrayRef aArray, PRInt32 aIndex, nsAString &aResult)
 

Variables

static
nsSafariProfileMigrator::PrefTransform 
gTransforms []
 
static const charsetEntry gCharsets []
 

Macro Definition Documentation

#define _SPM (   type)    nsSafariProfileMigrator::type

Definition at line 339 of file nsSafariProfileMigrator.cpp.

#define CHARSET_ENTRY (   charsetLabel,
  associatedLangGroup 
)    {#charsetLabel, sizeof(#charsetLabel) - 1, #charsetLabel, #associatedLangGroup}
#define CHARSET_ENTRY2 (   webkitLabel,
  mozLabel,
  associatedLangGroup 
)    {#webkitLabel, sizeof(#webkitLabel) - 1, #mozLabel, #associatedLangGroup}
#define MIGRATION_BUNDLE   "chrome://browser/locale/migration/migration.properties"

Definition at line 78 of file nsSafariProfileMigrator.cpp.

#define SAFARI_BOOKMARKS_FILE_NAME   NS_LITERAL_STRING("Bookmarks.plist")

Definition at line 72 of file nsSafariProfileMigrator.cpp.

#define SAFARI_COOKIE_BEHAVIOR_FILE_NAME   NS_LITERAL_STRING("com.apple.WebFoundation.plist")

Definition at line 75 of file nsSafariProfileMigrator.cpp.

#define SAFARI_COOKIES_FILE_NAME   NS_LITERAL_STRING("Cookies.plist")

Definition at line 74 of file nsSafariProfileMigrator.cpp.

#define SAFARI_DATE_OFFSET   978307200

Definition at line 76 of file nsSafariProfileMigrator.cpp.

#define SAFARI_HISTORY_FILE_NAME   NS_LITERAL_STRING("History.plist")

Definition at line 73 of file nsSafariProfileMigrator.cpp.

#define SAFARI_HOME_PAGE_PREF   "HomePage"

Definition at line 77 of file nsSafariProfileMigrator.cpp.

#define SAFARI_PREFERENCES_FILE_NAME   NS_LITERAL_STRING("com.apple.Safari.plist")

Definition at line 71 of file nsSafariProfileMigrator.cpp.

Function Documentation

CFPropertyListRef CopyPListFromFile ( nsILocalFile *  aPListFile)

Definition at line 214 of file nsSafariProfileMigrator.cpp.

Here is the caller graph for this function:

CFDictionaryRef CopySafariPrefs ( )

Definition at line 255 of file nsSafariProfileMigrator.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void FreeNullTerminatedString ( char *  aString)

Definition at line 282 of file nsSafariProfileMigrator.cpp.

Here is the caller graph for this function:

PRBool GetArrayStringValue ( CFArrayRef  aArray,
PRInt32  aIndex,
nsAString &  aResult 
)

Definition at line 324 of file nsSafariProfileMigrator.cpp.

Here is the caller graph for this function:

PRBool GetDictionaryCStringValue ( CFDictionaryRef  aDictionary,
CFStringRef  aKey,
nsACString &  aResult,
CFStringEncoding  aEncoding 
)

Definition at line 306 of file nsSafariProfileMigrator.cpp.

Here is the caller graph for this function:

PRBool GetDictionaryStringValue ( CFDictionaryRef  aDictionary,
CFStringRef  aKey,
nsAString &  aResult 
)

Definition at line 289 of file nsSafariProfileMigrator.cpp.

Here is the caller graph for this function:

char* GetNullTerminatedString ( CFStringRef  aStringRef)

Definition at line 269 of file nsSafariProfileMigrator.cpp.

Here is the caller graph for this function:

Variable Documentation

const charsetEntry gCharsets[]
static

Definition at line 396 of file nsSafariProfileMigrator.cpp.

Initial value:
= {
{ CFSTR("AlwaysShowTabBar"), nsSafariProfileMigrator:: BOOL , "browser.tabs.autoHide", nsSafariProfileMigrator:: SetBoolInverted , PR_FALSE, -1 },
{ CFSTR("AutoFillPasswords"), nsSafariProfileMigrator:: BOOL , "signon.rememberSignons", nsSafariProfileMigrator:: SetBool , PR_FALSE, -1 },
{ CFSTR("OpenNewTabsInFront"), nsSafariProfileMigrator:: BOOL , "browser.tabs.loadInBackground", nsSafariProfileMigrator:: SetBoolInverted , PR_FALSE, -1 },
{ CFSTR("NSDefaultOpenDir"), nsSafariProfileMigrator:: STRING , "browser.download.dir", nsSafariProfileMigrator:: SetDownloadFolder , PR_FALSE, -1 },
{ CFSTR("AutoOpenSafeDownloads"), nsSafariProfileMigrator:: BOOL , nsnull, nsSafariProfileMigrator:: SetDownloadHandlers , PR_FALSE, -1 },
{ CFSTR("DownloadsClearingPolicy"), nsSafariProfileMigrator:: INT , "browser.download.manager.retention", nsSafariProfileMigrator:: SetDownloadRetention , PR_FALSE, -1 },
{ CFSTR("WebKitDefaultTextEncodingName"),nsSafariProfileMigrator:: STRING , "intl.charset.default", nsSafariProfileMigrator:: SetDefaultEncoding , PR_FALSE, -1 },
{ CFSTR("WebKitStandardFont"), nsSafariProfileMigrator:: STRING , "font.name.serif.", nsSafariProfileMigrator:: SetFontName , PR_FALSE, -1 },
{ CFSTR("WebKitDefaultFontSize"), nsSafariProfileMigrator:: INT , "font.size.serif.", nsSafariProfileMigrator:: SetFontSize , PR_FALSE, -1 },
{ CFSTR("WebKitFixedFont"), nsSafariProfileMigrator:: STRING , "font.name.fixed.", nsSafariProfileMigrator:: SetFontName , PR_FALSE, -1 },
{ CFSTR("WebKitDefaultFixedFontSize"), nsSafariProfileMigrator:: INT , "font.size.fixed.", nsSafariProfileMigrator:: SetFontSize , PR_FALSE, -1 },
{ CFSTR("WebKitMinimumFontSize"), nsSafariProfileMigrator:: INT , "font.minimum-size.", nsSafariProfileMigrator:: SetFontSize , PR_FALSE, -1 },
{ CFSTR("WebKitDisplayImagesKey"), nsSafariProfileMigrator:: BOOL , "permissions.default.image", nsSafariProfileMigrator:: SetDisplayImages , PR_FALSE, -1 },
{ CFSTR("WebKitJavaScriptEnabled"), nsSafariProfileMigrator:: BOOL , "javascript.enabled", nsSafariProfileMigrator:: SetBool , PR_FALSE, -1 },
{ CFSTR("WebKitJavaScriptCanOpenWindowsAutomatically"),
nsSafariProfileMigrator:: BOOL , "dom.disable_open_during_load", nsSafariProfileMigrator:: SetBoolInverted , PR_FALSE, -1 }
}
static nsresult SetDownloadFolder(void *aTransform, nsIPrefBranch *aBranch)
static nsresult SetDownloadRetention(void *aTransform, nsIPrefBranch *aBranch)
static nsresult SetDisplayImages(void *aTransform, nsIPrefBranch *aBranch)
static nsresult SetFontName(void *aTransform, nsIPrefBranch *aBranch)
static nsresult SetDefaultEncoding(void *aTransform, nsIPrefBranch *aBranch)
static nsresult SetFontSize(void *aTransform, nsIPrefBranch *aBranch)
static nsresult SetDownloadHandlers(void *aTransform, nsIPrefBranch *aBranch)
static nsresult SetBoolInverted(void *aTransform, nsIPrefBranch *aBranch)
static nsresult SetBool(void *aTransform, nsIPrefBranch *aBranch)

Definition at line 342 of file nsSafariProfileMigrator.cpp.