Remap cookie prefs to be something chimera understands before we

get to the pref panel. Ignore p3p and foreign cookies.
This commit is contained in:
pinkerton%netscape.com 2002-06-22 21:21:44 +00:00
Родитель ac79a72cbb
Коммит 89fa8ab607
6 изменённых файлов: 62 добавлений и 6 удалений

Просмотреть файл

@ -166,6 +166,20 @@ app_getModuleInfo(nsStaticModuleInfo **info, PRUint32 *count);
return;
}
// fix up the cookie prefs. If 'p3p' or 'accept foreign cookies' are on, remap them to
// something that chimera can deal with.
PRInt32 acceptCookies = 0;
static const char* kCookieBehaviorPref = "network.cookie.cookieBehavior";
prefs->GetIntPref(kCookieBehaviorPref, &acceptCookies);
if ( acceptCookies == 1 ) { // accept foreign cookies, assume off
acceptCookies = 2;
prefs->SetIntPref(kCookieBehaviorPref, acceptCookies);
}
else if ( acceptCookies == 3 ) { // p3p, assume all cookies on
acceptCookies = 0;
prefs->SetIntPref(kCookieBehaviorPref, acceptCookies);
}
// get home page from Internet Config
string = [self getICStringPref:kICWWWHomePage];
if (string) {

Просмотреть файл

@ -35,11 +35,11 @@
return;
// Hookup cookie prefs. Relies on the tags of the radio buttons in the matrix being
// set such that "enable all" is 0 and "disable all" is 2.
// set such that "enable all" is 0 and "disable all" is 2. If mozilla has other prefs
// that we don't quite know about, we assume they were remapped by the CHPreferenceManager
// at startup.
PRInt32 acceptCookies = 0;
mPrefService->GetIntPref("network.cookie.cookieBehavior", &acceptCookies);
if ( acceptCookies == 1 ) // be safe in case of importing a mozilla profile
acceptCookies = 2;
if ( [mCookies selectCellWithTag:acceptCookies] != YES )
NS_WARNING("Bad value for network.cookie.cookieBehavior");

Просмотреть файл

@ -166,6 +166,20 @@ app_getModuleInfo(nsStaticModuleInfo **info, PRUint32 *count);
return;
}
// fix up the cookie prefs. If 'p3p' or 'accept foreign cookies' are on, remap them to
// something that chimera can deal with.
PRInt32 acceptCookies = 0;
static const char* kCookieBehaviorPref = "network.cookie.cookieBehavior";
prefs->GetIntPref(kCookieBehaviorPref, &acceptCookies);
if ( acceptCookies == 1 ) { // accept foreign cookies, assume off
acceptCookies = 2;
prefs->SetIntPref(kCookieBehaviorPref, acceptCookies);
}
else if ( acceptCookies == 3 ) { // p3p, assume all cookies on
acceptCookies = 0;
prefs->SetIntPref(kCookieBehaviorPref, acceptCookies);
}
// get home page from Internet Config
string = [self getICStringPref:kICWWWHomePage];
if (string) {

Просмотреть файл

@ -166,6 +166,20 @@ app_getModuleInfo(nsStaticModuleInfo **info, PRUint32 *count);
return;
}
// fix up the cookie prefs. If 'p3p' or 'accept foreign cookies' are on, remap them to
// something that chimera can deal with.
PRInt32 acceptCookies = 0;
static const char* kCookieBehaviorPref = "network.cookie.cookieBehavior";
prefs->GetIntPref(kCookieBehaviorPref, &acceptCookies);
if ( acceptCookies == 1 ) { // accept foreign cookies, assume off
acceptCookies = 2;
prefs->SetIntPref(kCookieBehaviorPref, acceptCookies);
}
else if ( acceptCookies == 3 ) { // p3p, assume all cookies on
acceptCookies = 0;
prefs->SetIntPref(kCookieBehaviorPref, acceptCookies);
}
// get home page from Internet Config
string = [self getICStringPref:kICWWWHomePage];
if (string) {

Просмотреть файл

@ -35,11 +35,11 @@
return;
// Hookup cookie prefs. Relies on the tags of the radio buttons in the matrix being
// set such that "enable all" is 0 and "disable all" is 2.
// set such that "enable all" is 0 and "disable all" is 2. If mozilla has other prefs
// that we don't quite know about, we assume they were remapped by the CHPreferenceManager
// at startup.
PRInt32 acceptCookies = 0;
mPrefService->GetIntPref("network.cookie.cookieBehavior", &acceptCookies);
if ( acceptCookies == 1 ) // be safe in case of importing a mozilla profile
acceptCookies = 2;
if ( [mCookies selectCellWithTag:acceptCookies] != YES )
NS_WARNING("Bad value for network.cookie.cookieBehavior");

Просмотреть файл

@ -166,6 +166,20 @@ app_getModuleInfo(nsStaticModuleInfo **info, PRUint32 *count);
return;
}
// fix up the cookie prefs. If 'p3p' or 'accept foreign cookies' are on, remap them to
// something that chimera can deal with.
PRInt32 acceptCookies = 0;
static const char* kCookieBehaviorPref = "network.cookie.cookieBehavior";
prefs->GetIntPref(kCookieBehaviorPref, &acceptCookies);
if ( acceptCookies == 1 ) { // accept foreign cookies, assume off
acceptCookies = 2;
prefs->SetIntPref(kCookieBehaviorPref, acceptCookies);
}
else if ( acceptCookies == 3 ) { // p3p, assume all cookies on
acceptCookies = 0;
prefs->SetIntPref(kCookieBehaviorPref, acceptCookies);
}
// get home page from Internet Config
string = [self getICStringPref:kICWWWHomePage];
if (string) {