From bf4470d09cdd371ab5658c7175d516a8a99fc67f Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Fri, 16 Sep 2005 20:14:09 +0000 Subject: [PATCH] Migrate network.image.imageBehavior to permissions.default.image. Bug 300916, patch by Frank Wein , r=mconnor git-svn-id: svn://10.0.0.236/trunk@180431 18797224-902f-48f8-a5cc-f745e15eee43 --- .../components/migration/src/nsDogbertProfileMigrator.cpp | 4 ++-- .../components/migration/src/nsIEProfileMigrator.cpp | 4 ++-- .../components/migration/src/nsOperaProfileMigrator.cpp | 4 ++-- .../components/migration/src/nsSafariProfileMigrator.cpp | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mozilla/browser/components/migration/src/nsDogbertProfileMigrator.cpp b/mozilla/browser/components/migration/src/nsDogbertProfileMigrator.cpp index 4d48c66f147..61a22a7b12d 100644 --- a/mozilla/browser/components/migration/src/nsDogbertProfileMigrator.cpp +++ b/mozilla/browser/components/migration/src/nsDogbertProfileMigrator.cpp @@ -417,7 +417,7 @@ nsDogbertProfileMigrator::PrefTransform gTransforms[] = { { "browser.use_document.fonts", "browser.display.use_document_fonts", F(GetInt), F(SetInt), PR_FALSE, -1 }, { "browser.link_expiration", "browser.history_expire_days", F(GetInt), F(SetInt), PR_FALSE, -1 }, { "browser.startup.page", "browser.startup.homepage", F(GetHomepage), F(SetWStringFromASCII), PR_FALSE, -1 }, - { "general.always_load_images", "network.image.imageBehavior", F(GetImagePref),F(SetInt), PR_FALSE, -1 }, + { "general.always_load_images", "permissions.default.image", F(GetImagePref),F(SetInt), PR_FALSE, -1 }, }; nsresult @@ -493,7 +493,7 @@ nsDogbertProfileMigrator::GetImagePref(void* aTransform, nsIPrefBranch* aBranch) PRBool loadImages; nsresult rv = aBranch->GetBoolPref(xform->sourcePrefName, &loadImages); if (NS_SUCCEEDED(rv)) { - xform->intValue = loadImages ? 0 : 2; + xform->intValue = loadImages ? 1 : 2; xform->prefHasValue = PR_TRUE; } return rv; diff --git a/mozilla/browser/components/migration/src/nsIEProfileMigrator.cpp b/mozilla/browser/components/migration/src/nsIEProfileMigrator.cpp index 1b085afcbdb..bd0f9cb70aa 100644 --- a/mozilla/browser/components/migration/src/nsIEProfileMigrator.cpp +++ b/mozilla/browser/components/migration/src/nsIEProfileMigrator.cpp @@ -155,7 +155,7 @@ TranslateYNtoImageBehavior(unsigned char *aRegValue, DWORD aRegValueLength, if (aRegValueType == REG_SZ && aRegValue[0] != 0) { // strcmp is safe; it's bounded by its second parameter if (!strcmp(NS_REINTERPRET_CAST(char *, aRegValue), "yes")) - prefs->SetIntPref(aPrefKeyName, 0); + prefs->SetIntPref(aPrefKeyName, 1); else prefs->SetIntPref(aPrefKeyName, 2); } @@ -361,7 +361,7 @@ struct regEntry gRegEntries[] = { TranslateYNtoTF }, { 0, "Display Inline Images", - "network.image.imageBehavior", + "permissions.default.image", TranslateYNtoImageBehavior }, { 0, "Enable AutoImageResize", diff --git a/mozilla/browser/components/migration/src/nsOperaProfileMigrator.cpp b/mozilla/browser/components/migration/src/nsOperaProfileMigrator.cpp index 8abb8a2340a..9e665b2f5cb 100644 --- a/mozilla/browser/components/migration/src/nsOperaProfileMigrator.cpp +++ b/mozilla/browser/components/migration/src/nsOperaProfileMigrator.cpp @@ -295,7 +295,7 @@ nsOperaProfileMigrator::PrefTransform gTransforms[] = { { nsnull, "Allow script to change status", _OPM(BOOL), "dom.disable_window_status_change", _OPM(SetBool), PR_FALSE, -1 }, { nsnull, "Home URL", _OPM(STRING), "browser.startup.homepage", _OPM(SetWString), PR_FALSE, -1 }, { nsnull, "Ignore Unrequested Popups", _OPM(BOOL), "dom.disable_open_during_load", _OPM(SetBool), PR_FALSE, -1 }, - { nsnull, "Load Figures", _OPM(BOOL), "network.image.imageBehavior", _OPM(SetImageBehavior), PR_FALSE, -1 }, + { nsnull, "Load Figures", _OPM(BOOL), "permissions.default.image", _OPM(SetImageBehavior), PR_FALSE, -1 }, { "Visited link", nsnull, _OPM(COLOR), "browser.visited_color", _OPM(SetString), PR_FALSE, -1 }, { "Link", nsnull, _OPM(COLOR), "browser.anchor_color", _OPM(SetString), PR_FALSE, -1 }, @@ -330,7 +330,7 @@ nsresult nsOperaProfileMigrator::SetImageBehavior(void* aTransform, nsIPrefBranch* aBranch) { PrefTransform* xform = (PrefTransform*)aTransform; - return aBranch->SetIntPref(xform->targetPrefName, xform->boolValue ? 0 : 2); + return aBranch->SetIntPref(xform->targetPrefName, xform->boolValue ? 1 : 2); } nsresult diff --git a/mozilla/browser/components/migration/src/nsSafariProfileMigrator.cpp b/mozilla/browser/components/migration/src/nsSafariProfileMigrator.cpp index e8308253601..ed55bf3d837 100644 --- a/mozilla/browser/components/migration/src/nsSafariProfileMigrator.cpp +++ b/mozilla/browser/components/migration/src/nsSafariProfileMigrator.cpp @@ -342,7 +342,7 @@ nsSafariProfileMigrator::PrefTransform gTransforms[] = { { CFSTR("WebKitFixedFont"), _SPM(STRING), "font.name.fixed.", _SPM(SetFontName), PR_FALSE, -1 }, { CFSTR("WebKitDefaultFixedFontSize"), _SPM(INT), "font.size.fixed.", _SPM(SetFontSize), PR_FALSE, -1 }, { CFSTR("WebKitMinimumFontSize"), _SPM(INT), "font.minimum-size.", _SPM(SetFontSize), PR_FALSE, -1 }, - { CFSTR("WebKitDisplayImagesKey"), _SPM(BOOL), "network.image.imageBehavior", _SPM(SetDisplayImages), PR_FALSE, -1 }, + { CFSTR("WebKitDisplayImagesKey"), _SPM(BOOL), "permissions.default.image", _SPM(SetDisplayImages), PR_FALSE, -1 }, { CFSTR("WebKitJavaEnabled"), _SPM(BOOL), "security.enable_java", _SPM(SetBool), PR_FALSE, -1 }, { CFSTR("WebKitJavaScriptEnabled"), _SPM(BOOL), "javascript.enabled", _SPM(SetBool), PR_FALSE, -1 }, { CFSTR("WebKitJavaScriptCanOpenWindowsAutomatically"), @@ -614,10 +614,10 @@ nsSafariProfileMigrator::SetDisplayImages(void* aTransform, nsIPrefBranch* aBran // Firefox has an elaborate set of Image preferences. The correlation is: // Mode: Safari Firefox // Blocked FALSE 2 - // Allowed TRUE 0 - // Allowed, originating site only -- 1 + // Allowed TRUE 1 + // Allowed, originating site only -- 3 PrefTransform* xform = (PrefTransform*)aTransform; - aBranch->SetIntPref(xform->targetPrefName, xform->boolValue ? 0 : 2); + aBranch->SetIntPref(xform->targetPrefName, xform->boolValue ? 1 : 2); return NS_OK; }