Bug 337231 - Migrate Opera's "Accept Cookies Session Only" preference into network.cookie.lifetimePolicy instead of the unused network.cookie.enableForCurrentSessionOnly. r=gavin, a=schrep

This commit is contained in:
dwitte@stanford.edu 2008-01-03 16:09:03 -08:00
parent 2c3144edc3
commit f9ac76c5cf
2 changed files with 9 additions and 1 deletions

View File

@ -316,7 +316,7 @@ static
nsOperaProfileMigrator::PrefTransform gTransforms[] = {
{ "User Prefs", "Download Directory", _OPM(STRING), "browser.download.dir", _OPM(SetFile), PR_FALSE, -1 },
{ nsnull, "Enable Cookies", _OPM(INT), "network.cookie.cookieBehavior", _OPM(SetCookieBehavior), PR_FALSE, -1 },
{ nsnull, "Accept Cookies Session Only", _OPM(BOOL), "network.cookie.enableForCurrentSessionOnly", _OPM(SetBool), PR_FALSE, -1 },
{ nsnull, "Accept Cookies Session Only", _OPM(BOOL), "network.cookie.lifetimePolicy", _OPM(SetCookieLifetime), PR_FALSE, -1 },
{ nsnull, "Allow script to resize window", _OPM(BOOL), "dom.disable_window_move_resize", _OPM(SetBool), PR_FALSE, -1 },
{ nsnull, "Allow script to move window", _OPM(BOOL), "dom.disable_window_move_resize", _OPM(SetBool), PR_FALSE, -1 },
{ nsnull, "Allow script to raise window", _OPM(BOOL), "dom.disable_window_flip", _OPM(SetBool), PR_FALSE, -1 },
@ -353,6 +353,13 @@ nsOperaProfileMigrator::SetCookieBehavior(void* aTransform, nsIPrefBranch* aBran
return aBranch->SetIntPref(xform->targetPrefName, val);
}
nsresult
nsOperaProfileMigrator::SetCookieLifetime(void* aTransform, nsIPrefBranch* aBranch)
{
PrefTransform* xform = (PrefTransform*)aTransform;
return aBranch->SetIntPref(xform->targetPrefName, xform->boolValue ? 2 : 0);
}
nsresult
nsOperaProfileMigrator::SetImageBehavior(void* aTransform, nsIPrefBranch* aBranch)
{

View File

@ -89,6 +89,7 @@ public:
static nsresult SetFile(void* aTransform, nsIPrefBranch* aBranch);
static nsresult SetCookieBehavior(void* aTransform, nsIPrefBranch* aBranch);
static nsresult SetCookieLifetime(void* aTransform, nsIPrefBranch* aBranch);
static nsresult SetImageBehavior(void* aTransform, nsIPrefBranch* aBranch);
static nsresult SetBool(void* aTransform, nsIPrefBranch* aBranch);
static nsresult SetWString(void* aTransform, nsIPrefBranch* aBranch);