mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 13:56:29 +00:00
Move cache clearing button to Navigation panel, add security prefs to
Privacy panel. make privacy panel inherit from base prefpanel class.
This commit is contained in:
parent
64b9fb5048
commit
e5fa70f42c
@ -17,6 +17,7 @@
|
||||
checkboxClicked = id;
|
||||
checkboxStartPageClicked = id;
|
||||
checkboxUseSystemHomePageClicked = id;
|
||||
clearDiskCache = id;
|
||||
clearGlobalHistory = id;
|
||||
historyDaysModified = id;
|
||||
openSystemInternetPanel = id;
|
||||
|
@ -3,7 +3,7 @@
|
||||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>109 32 522 320 0 0 1152 746 </string>
|
||||
<string>1166 344 522 320 1152 -88 1280 1024 </string>
|
||||
<key>IBFramework Version</key>
|
||||
<string>248.0</string>
|
||||
<key>IBGroupedObjects</key>
|
||||
@ -17,7 +17,11 @@
|
||||
</dict>
|
||||
<key>IBLastGroupID</key>
|
||||
<string>8</string>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>5</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>5S66</string>
|
||||
<string>5S60</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
Binary file not shown.
@ -51,4 +51,6 @@
|
||||
- (NSString*)getSystemHomePage;
|
||||
- (NSString*)getCurrentHomePage;
|
||||
|
||||
-(IBAction) clearDiskCache:(id)aSender;
|
||||
|
||||
@end
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "nsIPref.h"
|
||||
#include "nsIBrowserHistory.h"
|
||||
#include "nsICacheService.h"
|
||||
|
||||
const int kDefaultExpireDays = 9;
|
||||
|
||||
@ -216,4 +217,16 @@ const int kDefaultExpireDays = 9;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// clearDiskCache:
|
||||
//
|
||||
// Clear the user's disk cache
|
||||
//
|
||||
-(IBAction) clearDiskCache:(id)aSender
|
||||
{
|
||||
nsCOMPtr<nsICacheService> cacheServ ( do_GetService("@mozilla.org/network/cache-service;1") );
|
||||
if ( cacheServ )
|
||||
cacheServ->EvictEntries(nsICache::STORE_ON_DISK);
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -17,6 +17,7 @@
|
||||
checkboxClicked = id;
|
||||
checkboxStartPageClicked = id;
|
||||
checkboxUseSystemHomePageClicked = id;
|
||||
clearDiskCache = id;
|
||||
clearGlobalHistory = id;
|
||||
historyDaysModified = id;
|
||||
openSystemInternetPanel = id;
|
||||
|
@ -3,7 +3,7 @@
|
||||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>109 32 522 320 0 0 1152 746 </string>
|
||||
<string>1166 344 522 320 1152 -88 1280 1024 </string>
|
||||
<key>IBFramework Version</key>
|
||||
<string>248.0</string>
|
||||
<key>IBGroupedObjects</key>
|
||||
@ -17,7 +17,11 @@
|
||||
</dict>
|
||||
<key>IBLastGroupID</key>
|
||||
<string>8</string>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>5</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>5S66</string>
|
||||
<string>5S60</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
Binary file not shown.
@ -10,10 +10,12 @@
|
||||
{
|
||||
ACTIONS = {
|
||||
clearCookies = id;
|
||||
clearDiskCache = id;
|
||||
clickEnableCookies = id;
|
||||
clickEnableJS = id;
|
||||
clickEnableJava = id;
|
||||
clickEnableLeaveEncrypted = id;
|
||||
clickEnableLoadLowGrade = id;
|
||||
clickEnableViewMixed = id;
|
||||
clickPromptForCookie = id;
|
||||
};
|
||||
CLASS = OrgMozillaChimeraPreferencePrivacy;
|
||||
@ -22,7 +24,10 @@
|
||||
mCookies = id;
|
||||
mEnableJS = NSButton;
|
||||
mEnableJava = NSButton;
|
||||
mLeaveEncrypted = NSButton;
|
||||
mLoadLowGrade = NSButton;
|
||||
mPromptForCookie = NSButton;
|
||||
mViewMixed = NSButton;
|
||||
};
|
||||
SUPERCLASS = NSPreferencePane;
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>119 80 356 240 0 0 1152 746 </string>
|
||||
<string>1218 97 356 240 1152 -88 1280 1024 </string>
|
||||
<key>IBFramework Version</key>
|
||||
<string>248.0</string>
|
||||
<key>IBGroupedObjects</key>
|
||||
@ -16,7 +16,11 @@
|
||||
</dict>
|
||||
<key>IBLastGroupID</key>
|
||||
<string>4</string>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>5</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>5S66</string>
|
||||
<string>5S60</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
Binary file not shown.
@ -10,10 +10,12 @@
|
||||
{
|
||||
ACTIONS = {
|
||||
clearCookies = id;
|
||||
clearDiskCache = id;
|
||||
clickEnableCookies = id;
|
||||
clickEnableJS = id;
|
||||
clickEnableJava = id;
|
||||
clickEnableLeaveEncrypted = id;
|
||||
clickEnableLoadLowGrade = id;
|
||||
clickEnableViewMixed = id;
|
||||
clickPromptForCookie = id;
|
||||
};
|
||||
CLASS = OrgMozillaChimeraPreferencePrivacy;
|
||||
@ -22,7 +24,10 @@
|
||||
mCookies = id;
|
||||
mEnableJS = NSButton;
|
||||
mEnableJava = NSButton;
|
||||
mLeaveEncrypted = NSButton;
|
||||
mLoadLowGrade = NSButton;
|
||||
mPromptForCookie = NSButton;
|
||||
mViewMixed = NSButton;
|
||||
};
|
||||
SUPERCLASS = NSPreferencePane;
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>119 80 356 240 0 0 1152 746 </string>
|
||||
<string>1218 97 356 240 1152 -88 1280 1024 </string>
|
||||
<key>IBFramework Version</key>
|
||||
<string>248.0</string>
|
||||
<key>IBGroupedObjects</key>
|
||||
@ -16,7 +16,11 @@
|
||||
</dict>
|
||||
<key>IBLastGroupID</key>
|
||||
<string>4</string>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>5</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>5S66</string>
|
||||
<string>5S60</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
BIN
camino/PreferencePanes/Privacy/Privacy.nib/objects.nib
generated
BIN
camino/PreferencePanes/Privacy/Privacy.nib/objects.nib
generated
Binary file not shown.
@ -1,9 +1,10 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <PreferencePanes/NSPreferencePane.h>
|
||||
#import "PreferencePaneBase.h"
|
||||
|
||||
class nsIPref;
|
||||
|
||||
@interface OrgMozillaChimeraPreferencePrivacy : NSPreferencePane
|
||||
@interface OrgMozillaChimeraPreferencePrivacy : PreferencePaneBase
|
||||
{
|
||||
IBOutlet id mCookies;
|
||||
IBOutlet NSButton* mPromptForCookie;
|
||||
@ -11,15 +12,20 @@ class nsIPref;
|
||||
IBOutlet NSButton* mEnableJS;
|
||||
IBOutlet NSButton* mEnableJava;
|
||||
|
||||
nsIPref* mPrefService; // strong ref, but can't use comPtr here
|
||||
IBOutlet NSButton* mLeaveEncrypted;
|
||||
IBOutlet NSButton* mLoadLowGrade;
|
||||
IBOutlet NSButton* mViewMixed;
|
||||
}
|
||||
|
||||
-(IBAction) clearCookies:(id)aSender;
|
||||
-(IBAction) clearDiskCache:(id)aSender;
|
||||
|
||||
-(IBAction) clickPromptForCookie:(id)sender;
|
||||
-(IBAction) clickEnableCookies:(id)sender;
|
||||
-(IBAction) clickEnableJS:(id)sender;
|
||||
-(IBAction) clickEnableJava:(id)sender;
|
||||
|
||||
-(IBAction) clickEnableLeaveEncrypted:(id)sender;
|
||||
-(IBAction) clickEnableLoadLowGrade:(id)sender;
|
||||
-(IBAction) clickEnableViewMixed:(id)sender;
|
||||
|
||||
@end
|
||||
|
@ -4,7 +4,11 @@
|
||||
#include "nsIServiceManagerUtils.h"
|
||||
#include "nsIPref.h"
|
||||
#include "nsCCookieManager.h"
|
||||
#include "nsICacheService.h"
|
||||
|
||||
// prefs for showing security dialogs
|
||||
#define WEAK_SITE_PREF "security.warn_entering_weak"
|
||||
#define LEAVE_SITE_PREF "security.warn_leaving_secure"
|
||||
#define MIXEDCONTENT_PREF "security.warn_viewing_mixed"
|
||||
|
||||
@implementation OrgMozillaChimeraPreferencePrivacy
|
||||
|
||||
@ -14,21 +18,6 @@
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id) initWithBundle:(NSBundle *) bundle
|
||||
{
|
||||
self = [super initWithBundle:bundle] ;
|
||||
|
||||
nsCOMPtr<nsIPref> prefService ( do_GetService(NS_PREF_CONTRACTID) );
|
||||
NS_ASSERTION(prefService, "Could not get pref service, pref panel left uninitialized");
|
||||
mPrefService = prefService.get();
|
||||
NS_IF_ADDREF(mPrefService);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
}
|
||||
|
||||
- (void)mainViewDidLoad
|
||||
{
|
||||
@ -48,6 +37,8 @@
|
||||
mPrefService->GetBoolPref("network.cookie.warnAboutCookies", &warnAboutCookies);
|
||||
[mPromptForCookie setState:(warnAboutCookies ? NSOnState : NSOffState)];
|
||||
|
||||
// Set initial value on Java/JavaScript checkboxes
|
||||
|
||||
PRBool jsEnabled = PR_TRUE;
|
||||
mPrefService->GetBoolPref("javascript.enabled", &jsEnabled);
|
||||
[mEnableJS setState:(jsEnabled ? NSOnState : NSOffState)];
|
||||
@ -55,6 +46,20 @@
|
||||
PRBool javaEnabled = PR_TRUE;
|
||||
mPrefService->GetBoolPref("security.enable_java", &javaEnabled);
|
||||
[mEnableJava setState:(javaEnabled ? NSOnState : NSOffState)];
|
||||
|
||||
// Set initial value on Security checkboxes
|
||||
|
||||
PRBool leaveEncrypted = PR_TRUE;
|
||||
mPrefService->GetBoolPref(LEAVE_SITE_PREF, &leaveEncrypted);
|
||||
[mLeaveEncrypted setState:(leaveEncrypted ? NSOnState : NSOffState)];
|
||||
|
||||
PRBool loadLowGrade = PR_TRUE;
|
||||
mPrefService->GetBoolPref(WEAK_SITE_PREF, &loadLowGrade);
|
||||
[mLoadLowGrade setState:(loadLowGrade ? NSOnState : NSOffState)];
|
||||
|
||||
PRBool viewMixed = PR_TRUE;
|
||||
mPrefService->GetBoolPref(MIXEDCONTENT_PREF, &viewMixed);
|
||||
[mViewMixed setState:(viewMixed ? NSOnState : NSOffState)];
|
||||
}
|
||||
|
||||
//
|
||||
@ -69,18 +74,6 @@
|
||||
cookieMonster->RemoveAll();
|
||||
}
|
||||
|
||||
//
|
||||
// clearDiskCache:
|
||||
//
|
||||
// Clear the user's disk cache
|
||||
//
|
||||
-(IBAction) clearDiskCache:(id)aSender
|
||||
{
|
||||
nsCOMPtr<nsICacheService> cacheServ ( do_GetService("@mozilla.org/network/cache-service;1") );
|
||||
if ( cacheServ )
|
||||
cacheServ->EvictEntries(nsICache::STORE_ON_DISK);
|
||||
}
|
||||
|
||||
//
|
||||
// clickPromptForCookie:
|
||||
//
|
||||
@ -88,10 +81,7 @@
|
||||
//
|
||||
-(IBAction) clickPromptForCookie:(id)sender
|
||||
{
|
||||
if ( !mPrefService )
|
||||
return;
|
||||
mPrefService->SetBoolPref("network.cookie.warnAboutCookies",
|
||||
[mPromptForCookie state] == NSOnState ? PR_TRUE : PR_FALSE);
|
||||
[self setPref:"network.cookie.warnAboutCookies" toBoolean:[sender state] == NSOnState];
|
||||
}
|
||||
|
||||
//
|
||||
@ -114,10 +104,7 @@
|
||||
//
|
||||
-(IBAction) clickEnableJS:(id)sender
|
||||
{
|
||||
if ( !mPrefService )
|
||||
return;
|
||||
mPrefService->SetBoolPref("javascript.enabled",
|
||||
[mEnableJS state] == NSOnState ? PR_TRUE : PR_FALSE);
|
||||
[self setPref:"javascript.enabled" toBoolean:[sender state] == NSOnState];
|
||||
}
|
||||
|
||||
//
|
||||
@ -127,10 +114,30 @@
|
||||
//
|
||||
-(IBAction) clickEnableJava:(id)sender
|
||||
{
|
||||
if ( !mPrefService )
|
||||
return;
|
||||
mPrefService->SetBoolPref("security.enable_java",
|
||||
[mEnableJava state] == NSOnState ? PR_TRUE : PR_FALSE);
|
||||
[self setPref:"security.enable_java" toBoolean:[sender state] == NSOnState];
|
||||
}
|
||||
|
||||
//
|
||||
// clickEnableViewMixed:
|
||||
// clickEnableLoadLowGrade:
|
||||
// clickEnableLeaveEncrypted:
|
||||
//
|
||||
// Set prefs for warnings/alerts wrt secure sites
|
||||
//
|
||||
|
||||
-(IBAction) clickEnableViewMixed:(id)sender
|
||||
{
|
||||
[self setPref:MIXEDCONTENT_PREF toBoolean:[sender state] == NSOnState];
|
||||
}
|
||||
|
||||
-(IBAction) clickEnableLoadLowGrade:(id)sender
|
||||
{
|
||||
[self setPref:WEAK_SITE_PREF toBoolean:[sender state] == NSOnState];
|
||||
}
|
||||
|
||||
-(IBAction) clickEnableLeaveEncrypted:(id)sender
|
||||
{
|
||||
[self setPref:LEAVE_SITE_PREF toBoolean:[sender state] == NSOnState];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -17,6 +17,7 @@
|
||||
checkboxClicked = id;
|
||||
checkboxStartPageClicked = id;
|
||||
checkboxUseSystemHomePageClicked = id;
|
||||
clearDiskCache = id;
|
||||
clearGlobalHistory = id;
|
||||
historyDaysModified = id;
|
||||
openSystemInternetPanel = id;
|
||||
|
@ -3,7 +3,7 @@
|
||||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>109 32 522 320 0 0 1152 746 </string>
|
||||
<string>1166 344 522 320 1152 -88 1280 1024 </string>
|
||||
<key>IBFramework Version</key>
|
||||
<string>248.0</string>
|
||||
<key>IBGroupedObjects</key>
|
||||
@ -17,7 +17,11 @@
|
||||
</dict>
|
||||
<key>IBLastGroupID</key>
|
||||
<string>8</string>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>5</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>5S66</string>
|
||||
<string>5S60</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
Binary file not shown.
@ -51,4 +51,6 @@
|
||||
- (NSString*)getSystemHomePage;
|
||||
- (NSString*)getCurrentHomePage;
|
||||
|
||||
-(IBAction) clearDiskCache:(id)aSender;
|
||||
|
||||
@end
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "nsIPref.h"
|
||||
#include "nsIBrowserHistory.h"
|
||||
#include "nsICacheService.h"
|
||||
|
||||
const int kDefaultExpireDays = 9;
|
||||
|
||||
@ -216,4 +217,16 @@ const int kDefaultExpireDays = 9;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// clearDiskCache:
|
||||
//
|
||||
// Clear the user's disk cache
|
||||
//
|
||||
-(IBAction) clearDiskCache:(id)aSender
|
||||
{
|
||||
nsCOMPtr<nsICacheService> cacheServ ( do_GetService("@mozilla.org/network/cache-service;1") );
|
||||
if ( cacheServ )
|
||||
cacheServ->EvictEntries(nsICache::STORE_ON_DISK);
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -17,6 +17,7 @@
|
||||
checkboxClicked = id;
|
||||
checkboxStartPageClicked = id;
|
||||
checkboxUseSystemHomePageClicked = id;
|
||||
clearDiskCache = id;
|
||||
clearGlobalHistory = id;
|
||||
historyDaysModified = id;
|
||||
openSystemInternetPanel = id;
|
||||
|
@ -3,7 +3,7 @@
|
||||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>109 32 522 320 0 0 1152 746 </string>
|
||||
<string>1166 344 522 320 1152 -88 1280 1024 </string>
|
||||
<key>IBFramework Version</key>
|
||||
<string>248.0</string>
|
||||
<key>IBGroupedObjects</key>
|
||||
@ -17,7 +17,11 @@
|
||||
</dict>
|
||||
<key>IBLastGroupID</key>
|
||||
<string>8</string>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>5</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>5S66</string>
|
||||
<string>5S60</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
Binary file not shown.
@ -10,10 +10,12 @@
|
||||
{
|
||||
ACTIONS = {
|
||||
clearCookies = id;
|
||||
clearDiskCache = id;
|
||||
clickEnableCookies = id;
|
||||
clickEnableJS = id;
|
||||
clickEnableJava = id;
|
||||
clickEnableLeaveEncrypted = id;
|
||||
clickEnableLoadLowGrade = id;
|
||||
clickEnableViewMixed = id;
|
||||
clickPromptForCookie = id;
|
||||
};
|
||||
CLASS = OrgMozillaChimeraPreferencePrivacy;
|
||||
@ -22,7 +24,10 @@
|
||||
mCookies = id;
|
||||
mEnableJS = NSButton;
|
||||
mEnableJava = NSButton;
|
||||
mLeaveEncrypted = NSButton;
|
||||
mLoadLowGrade = NSButton;
|
||||
mPromptForCookie = NSButton;
|
||||
mViewMixed = NSButton;
|
||||
};
|
||||
SUPERCLASS = NSPreferencePane;
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>119 80 356 240 0 0 1152 746 </string>
|
||||
<string>1218 97 356 240 1152 -88 1280 1024 </string>
|
||||
<key>IBFramework Version</key>
|
||||
<string>248.0</string>
|
||||
<key>IBGroupedObjects</key>
|
||||
@ -16,7 +16,11 @@
|
||||
</dict>
|
||||
<key>IBLastGroupID</key>
|
||||
<string>4</string>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>5</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>5S66</string>
|
||||
<string>5S60</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
Binary file not shown.
@ -10,10 +10,12 @@
|
||||
{
|
||||
ACTIONS = {
|
||||
clearCookies = id;
|
||||
clearDiskCache = id;
|
||||
clickEnableCookies = id;
|
||||
clickEnableJS = id;
|
||||
clickEnableJava = id;
|
||||
clickEnableLeaveEncrypted = id;
|
||||
clickEnableLoadLowGrade = id;
|
||||
clickEnableViewMixed = id;
|
||||
clickPromptForCookie = id;
|
||||
};
|
||||
CLASS = OrgMozillaChimeraPreferencePrivacy;
|
||||
@ -22,7 +24,10 @@
|
||||
mCookies = id;
|
||||
mEnableJS = NSButton;
|
||||
mEnableJava = NSButton;
|
||||
mLeaveEncrypted = NSButton;
|
||||
mLoadLowGrade = NSButton;
|
||||
mPromptForCookie = NSButton;
|
||||
mViewMixed = NSButton;
|
||||
};
|
||||
SUPERCLASS = NSPreferencePane;
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>119 80 356 240 0 0 1152 746 </string>
|
||||
<string>1218 97 356 240 1152 -88 1280 1024 </string>
|
||||
<key>IBFramework Version</key>
|
||||
<string>248.0</string>
|
||||
<key>IBGroupedObjects</key>
|
||||
@ -16,7 +16,11 @@
|
||||
</dict>
|
||||
<key>IBLastGroupID</key>
|
||||
<string>4</string>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>5</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>5S66</string>
|
||||
<string>5S60</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
BIN
chimera/PreferencePanes/Privacy/Privacy.nib/objects.nib
generated
BIN
chimera/PreferencePanes/Privacy/Privacy.nib/objects.nib
generated
Binary file not shown.
@ -1,9 +1,10 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <PreferencePanes/NSPreferencePane.h>
|
||||
#import "PreferencePaneBase.h"
|
||||
|
||||
class nsIPref;
|
||||
|
||||
@interface OrgMozillaChimeraPreferencePrivacy : NSPreferencePane
|
||||
@interface OrgMozillaChimeraPreferencePrivacy : PreferencePaneBase
|
||||
{
|
||||
IBOutlet id mCookies;
|
||||
IBOutlet NSButton* mPromptForCookie;
|
||||
@ -11,15 +12,20 @@ class nsIPref;
|
||||
IBOutlet NSButton* mEnableJS;
|
||||
IBOutlet NSButton* mEnableJava;
|
||||
|
||||
nsIPref* mPrefService; // strong ref, but can't use comPtr here
|
||||
IBOutlet NSButton* mLeaveEncrypted;
|
||||
IBOutlet NSButton* mLoadLowGrade;
|
||||
IBOutlet NSButton* mViewMixed;
|
||||
}
|
||||
|
||||
-(IBAction) clearCookies:(id)aSender;
|
||||
-(IBAction) clearDiskCache:(id)aSender;
|
||||
|
||||
-(IBAction) clickPromptForCookie:(id)sender;
|
||||
-(IBAction) clickEnableCookies:(id)sender;
|
||||
-(IBAction) clickEnableJS:(id)sender;
|
||||
-(IBAction) clickEnableJava:(id)sender;
|
||||
|
||||
-(IBAction) clickEnableLeaveEncrypted:(id)sender;
|
||||
-(IBAction) clickEnableLoadLowGrade:(id)sender;
|
||||
-(IBAction) clickEnableViewMixed:(id)sender;
|
||||
|
||||
@end
|
||||
|
@ -4,7 +4,11 @@
|
||||
#include "nsIServiceManagerUtils.h"
|
||||
#include "nsIPref.h"
|
||||
#include "nsCCookieManager.h"
|
||||
#include "nsICacheService.h"
|
||||
|
||||
// prefs for showing security dialogs
|
||||
#define WEAK_SITE_PREF "security.warn_entering_weak"
|
||||
#define LEAVE_SITE_PREF "security.warn_leaving_secure"
|
||||
#define MIXEDCONTENT_PREF "security.warn_viewing_mixed"
|
||||
|
||||
@implementation OrgMozillaChimeraPreferencePrivacy
|
||||
|
||||
@ -14,21 +18,6 @@
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id) initWithBundle:(NSBundle *) bundle
|
||||
{
|
||||
self = [super initWithBundle:bundle] ;
|
||||
|
||||
nsCOMPtr<nsIPref> prefService ( do_GetService(NS_PREF_CONTRACTID) );
|
||||
NS_ASSERTION(prefService, "Could not get pref service, pref panel left uninitialized");
|
||||
mPrefService = prefService.get();
|
||||
NS_IF_ADDREF(mPrefService);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
}
|
||||
|
||||
- (void)mainViewDidLoad
|
||||
{
|
||||
@ -48,6 +37,8 @@
|
||||
mPrefService->GetBoolPref("network.cookie.warnAboutCookies", &warnAboutCookies);
|
||||
[mPromptForCookie setState:(warnAboutCookies ? NSOnState : NSOffState)];
|
||||
|
||||
// Set initial value on Java/JavaScript checkboxes
|
||||
|
||||
PRBool jsEnabled = PR_TRUE;
|
||||
mPrefService->GetBoolPref("javascript.enabled", &jsEnabled);
|
||||
[mEnableJS setState:(jsEnabled ? NSOnState : NSOffState)];
|
||||
@ -55,6 +46,20 @@
|
||||
PRBool javaEnabled = PR_TRUE;
|
||||
mPrefService->GetBoolPref("security.enable_java", &javaEnabled);
|
||||
[mEnableJava setState:(javaEnabled ? NSOnState : NSOffState)];
|
||||
|
||||
// Set initial value on Security checkboxes
|
||||
|
||||
PRBool leaveEncrypted = PR_TRUE;
|
||||
mPrefService->GetBoolPref(LEAVE_SITE_PREF, &leaveEncrypted);
|
||||
[mLeaveEncrypted setState:(leaveEncrypted ? NSOnState : NSOffState)];
|
||||
|
||||
PRBool loadLowGrade = PR_TRUE;
|
||||
mPrefService->GetBoolPref(WEAK_SITE_PREF, &loadLowGrade);
|
||||
[mLoadLowGrade setState:(loadLowGrade ? NSOnState : NSOffState)];
|
||||
|
||||
PRBool viewMixed = PR_TRUE;
|
||||
mPrefService->GetBoolPref(MIXEDCONTENT_PREF, &viewMixed);
|
||||
[mViewMixed setState:(viewMixed ? NSOnState : NSOffState)];
|
||||
}
|
||||
|
||||
//
|
||||
@ -69,18 +74,6 @@
|
||||
cookieMonster->RemoveAll();
|
||||
}
|
||||
|
||||
//
|
||||
// clearDiskCache:
|
||||
//
|
||||
// Clear the user's disk cache
|
||||
//
|
||||
-(IBAction) clearDiskCache:(id)aSender
|
||||
{
|
||||
nsCOMPtr<nsICacheService> cacheServ ( do_GetService("@mozilla.org/network/cache-service;1") );
|
||||
if ( cacheServ )
|
||||
cacheServ->EvictEntries(nsICache::STORE_ON_DISK);
|
||||
}
|
||||
|
||||
//
|
||||
// clickPromptForCookie:
|
||||
//
|
||||
@ -88,10 +81,7 @@
|
||||
//
|
||||
-(IBAction) clickPromptForCookie:(id)sender
|
||||
{
|
||||
if ( !mPrefService )
|
||||
return;
|
||||
mPrefService->SetBoolPref("network.cookie.warnAboutCookies",
|
||||
[mPromptForCookie state] == NSOnState ? PR_TRUE : PR_FALSE);
|
||||
[self setPref:"network.cookie.warnAboutCookies" toBoolean:[sender state] == NSOnState];
|
||||
}
|
||||
|
||||
//
|
||||
@ -114,10 +104,7 @@
|
||||
//
|
||||
-(IBAction) clickEnableJS:(id)sender
|
||||
{
|
||||
if ( !mPrefService )
|
||||
return;
|
||||
mPrefService->SetBoolPref("javascript.enabled",
|
||||
[mEnableJS state] == NSOnState ? PR_TRUE : PR_FALSE);
|
||||
[self setPref:"javascript.enabled" toBoolean:[sender state] == NSOnState];
|
||||
}
|
||||
|
||||
//
|
||||
@ -127,10 +114,30 @@
|
||||
//
|
||||
-(IBAction) clickEnableJava:(id)sender
|
||||
{
|
||||
if ( !mPrefService )
|
||||
return;
|
||||
mPrefService->SetBoolPref("security.enable_java",
|
||||
[mEnableJava state] == NSOnState ? PR_TRUE : PR_FALSE);
|
||||
[self setPref:"security.enable_java" toBoolean:[sender state] == NSOnState];
|
||||
}
|
||||
|
||||
//
|
||||
// clickEnableViewMixed:
|
||||
// clickEnableLoadLowGrade:
|
||||
// clickEnableLeaveEncrypted:
|
||||
//
|
||||
// Set prefs for warnings/alerts wrt secure sites
|
||||
//
|
||||
|
||||
-(IBAction) clickEnableViewMixed:(id)sender
|
||||
{
|
||||
[self setPref:MIXEDCONTENT_PREF toBoolean:[sender state] == NSOnState];
|
||||
}
|
||||
|
||||
-(IBAction) clickEnableLoadLowGrade:(id)sender
|
||||
{
|
||||
[self setPref:WEAK_SITE_PREF toBoolean:[sender state] == NSOnState];
|
||||
}
|
||||
|
||||
-(IBAction) clickEnableLeaveEncrypted:(id)sender
|
||||
{
|
||||
[self setPref:LEAVE_SITE_PREF toBoolean:[sender state] == NSOnState];
|
||||
}
|
||||
|
||||
@end
|
||||
|
Loading…
x
Reference in New Issue
Block a user