зеркало из https://github.com/mozilla/pjs.git
Camino only - Bug 411220: Create a header of pref constants. sr=pink
This commit is contained in:
Родитель
5bb286fb44
Коммит
84ae03ff21
|
@ -229,6 +229,8 @@
|
|||
3316F44C0D11F1900025ED19 /* TabButtonView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3316F4480D11F1900025ED19 /* TabButtonView.mm */; };
|
||||
337F2BA50CA200D100572F7D /* ContentDispatchChooser.mm in Sources */ = {isa = PBXBuildFile; fileRef = 337F2BA30CA200D100572F7D /* ContentDispatchChooser.mm */; };
|
||||
337F2BA70CA200D100572F7D /* ContentDispatchChooser.mm in Sources */ = {isa = PBXBuildFile; fileRef = 337F2BA30CA200D100572F7D /* ContentDispatchChooser.mm */; };
|
||||
33819AD70D938A3B00CA9F52 /* GeckoPrefConstants.mm in Sources */ = {isa = PBXBuildFile; fileRef = 33819AD30D938A2D00CA9F52 /* GeckoPrefConstants.mm */; };
|
||||
33819AD80D938A3B00CA9F52 /* GeckoPrefConstants.mm in Sources */ = {isa = PBXBuildFile; fileRef = 33819AD30D938A2D00CA9F52 /* GeckoPrefConstants.mm */; };
|
||||
33B775AA0C4EAC1E00A6D67F /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 33B775A90C4EAC1E00A6D67F /* libsqlite3.dylib */; };
|
||||
33B775AB0C4EAC1E00A6D67F /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 33B775A90C4EAC1E00A6D67F /* libsqlite3.dylib */; };
|
||||
33B7763C0C4EB32C00A6D67F /* libsqlite3.dylib in Copy Libraries */ = {isa = PBXBuildFile; fileRef = 33B775A90C4EAC1E00A6D67F /* libsqlite3.dylib */; };
|
||||
|
@ -2326,6 +2328,8 @@
|
|||
335639140C84DBDA00DC4D06 /* ViewCertificateDialogController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ViewCertificateDialogController.h; path = src/security/ViewCertificateDialogController.h; sourceTree = "<group>"; };
|
||||
337F2BA20CA200D100572F7D /* ContentDispatchChooser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ContentDispatchChooser.h; path = src/browser/ContentDispatchChooser.h; sourceTree = "<group>"; };
|
||||
337F2BA30CA200D100572F7D /* ContentDispatchChooser.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = ContentDispatchChooser.mm; path = src/browser/ContentDispatchChooser.mm; sourceTree = "<group>"; };
|
||||
33819AD20D938A2D00CA9F52 /* GeckoPrefConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GeckoPrefConstants.h; path = src/preferences/GeckoPrefConstants.h; sourceTree = "<group>"; };
|
||||
33819AD30D938A2D00CA9F52 /* GeckoPrefConstants.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = GeckoPrefConstants.mm; path = src/preferences/GeckoPrefConstants.mm; sourceTree = "<group>"; };
|
||||
33B775A90C4EAC1E00A6D67F /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = ../dist/lib/libsqlite3.dylib; sourceTree = SOURCE_ROOT; };
|
||||
33B777950C55851800A6D67F /* libmozlcms.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libmozlcms.dylib; path = ../dist/bin/libmozlcms.dylib; sourceTree = SOURCE_ROOT; };
|
||||
33B777E10C5588E500A6D67F /* libmozlcms.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmozlcms.a; path = ../dist/lib/libmozlcms.a; sourceTree = SOURCE_ROOT; };
|
||||
|
@ -4045,6 +4049,8 @@
|
|||
DEE9EBA60AF5C390002BC511 /* SessionManager.mm */,
|
||||
0FC4B33D08941B4F009C5F41 /* ChimeraUtils.h */,
|
||||
F5C8D55203A2A42401A8016F /* ChimeraUIConstants.h */,
|
||||
33819AD20D938A2D00CA9F52 /* GeckoPrefConstants.h */,
|
||||
33819AD30D938A2D00CA9F52 /* GeckoPrefConstants.mm */,
|
||||
F55C4DD302D2864D0130B065 /* UserDefaults.h */,
|
||||
29B97316FDCFA39411CA2CEA /* main.m */,
|
||||
33563A5A0C84EF3B00DC4D06 /* Gecko Support */,
|
||||
|
@ -5449,6 +5455,7 @@
|
|||
DE963D1C0D43EFCF007D44EE /* KeychainAutoCompleteSession.mm in Sources */,
|
||||
00BBBC860D66C13400C2D916 /* CHGradient.m in Sources */,
|
||||
001D4A270D75B0B100464BE4 /* MoveCommand.mm in Sources */,
|
||||
33819AD70D938A3B00CA9F52 /* GeckoPrefConstants.mm in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -5628,6 +5635,7 @@
|
|||
DE963D200D43EFCF007D44EE /* KeychainAutoCompleteSession.mm in Sources */,
|
||||
00BBBC850D66C13400C2D916 /* CHGradient.m in Sources */,
|
||||
001D4A260D75B0B100464BE4 /* MoveCommand.mm in Sources */,
|
||||
33819AD80D938A3B00CA9F52 /* GeckoPrefConstants.mm in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
|
@ -39,6 +39,8 @@
|
|||
|
||||
#import "Appearance.h"
|
||||
|
||||
#import "GeckoPrefConstants.h"
|
||||
|
||||
@interface OrgMozillaCaminoPreferenceAppearance(Private)
|
||||
|
||||
- (void)setupFontRegionPopup;
|
||||
|
@ -143,17 +145,17 @@
|
|||
{
|
||||
BOOL gotPref;
|
||||
[mUnderlineLinksCheckbox setState:
|
||||
[self getBooleanPref:"browser.underline_anchors" withSuccess:&gotPref]];
|
||||
[self getBooleanPref:kGeckoPrefUnderlineLinks withSuccess:&gotPref]];
|
||||
[mUseMyColorsCheckbox setState:
|
||||
![self getBooleanPref:"browser.display.use_document_colors" withSuccess:&gotPref]];
|
||||
![self getBooleanPref:kGeckoPrefUsePageColors withSuccess:&gotPref]];
|
||||
|
||||
// should save and restore this
|
||||
[[NSColorPanel sharedColorPanel] setContinuous:NO];
|
||||
|
||||
[mBackgroundColorWell setColor:[self getColorPref:"browser.display.background_color" withSuccess:&gotPref]];
|
||||
[mTextColorWell setColor:[self getColorPref:"browser.display.foreground_color" withSuccess:&gotPref]];
|
||||
[mUnvisitedLinksColorWell setColor:[self getColorPref:"browser.anchor_color" withSuccess:&gotPref]];
|
||||
[mVisitedLinksColorWell setColor:[self getColorPref:"browser.visited_color" withSuccess:&gotPref]];
|
||||
[mBackgroundColorWell setColor:[self getColorPref:kGeckoPrefPageBackgroundColor withSuccess:&gotPref]];
|
||||
[mTextColorWell setColor:[self getColorPref:kGeckoPrefPageForegroundColor withSuccess:&gotPref]];
|
||||
[mUnvisitedLinksColorWell setColor:[self getColorPref:kGeckoPrefLinkColor withSuccess:&gotPref]];
|
||||
[mVisitedLinksColorWell setColor:[self getColorPref:kGeckoPrefVisitedLinkColor withSuccess:&gotPref]];
|
||||
|
||||
[mUseMyFontsCheckbox setState:[self useMyFontsPref]];
|
||||
|
||||
|
@ -193,9 +195,9 @@
|
|||
- (IBAction)buttonClicked:(id)sender
|
||||
{
|
||||
if (sender == mUnderlineLinksCheckbox)
|
||||
[self setPref:"browser.underline_anchors" toBoolean:[sender state]];
|
||||
[self setPref:kGeckoPrefUnderlineLinks toBoolean:[sender state]];
|
||||
else if (sender == mUseMyColorsCheckbox)
|
||||
[self setPref:"browser.display.use_document_colors" toBoolean:![sender state]];
|
||||
[self setPref:kGeckoPrefUsePageColors toBoolean:![sender state]];
|
||||
}
|
||||
|
||||
- (IBAction)colorChanged:(id)sender
|
||||
|
@ -203,13 +205,13 @@
|
|||
const char* prefName = NULL;
|
||||
|
||||
if (sender == mBackgroundColorWell)
|
||||
prefName = "browser.display.background_color";
|
||||
prefName = kGeckoPrefPageBackgroundColor;
|
||||
else if (sender == mTextColorWell)
|
||||
prefName = "browser.display.foreground_color";
|
||||
prefName = kGeckoPrefPageForegroundColor;
|
||||
else if (sender == mUnvisitedLinksColorWell)
|
||||
prefName = "browser.anchor_color";
|
||||
prefName = kGeckoPrefLinkColor;
|
||||
else if (sender == mVisitedLinksColorWell)
|
||||
prefName = "browser.visited_color";
|
||||
prefName = kGeckoPrefVisitedLinkColor;
|
||||
|
||||
if (prefName)
|
||||
[self setPref:prefName toColor:[sender color]];
|
||||
|
@ -467,13 +469,13 @@
|
|||
- (BOOL)useMyFontsPref
|
||||
{
|
||||
BOOL gotPref;
|
||||
return [self getIntPref:"browser.display.use_document_fonts" withSuccess:&gotPref] == 0;
|
||||
return [self getIntPref:kGeckoPrefUsePageFonts withSuccess:&gotPref] == 0;
|
||||
}
|
||||
|
||||
- (void)setUseMyFontsPref:(BOOL)checkboxState
|
||||
{
|
||||
int useDocumentFonts = checkboxState ? 0 : 1;
|
||||
[self setPref:"browser.display.use_document_fonts" toInt:useDocumentFonts];
|
||||
[self setPref:kGeckoPrefUsePageFonts toInt:useDocumentFonts];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
@ -730,24 +732,24 @@ const int kDefaultFontSansSerifTag = 1;
|
|||
// Reset the "Colors and Links" tab to application factory defaults.
|
||||
- (IBAction)resetColorsToDefaults:(id)sender
|
||||
{
|
||||
[self clearPref:"browser.underline_anchors"];
|
||||
[self clearPref:"browser.display.use_document_colors"];
|
||||
[self clearPref:"browser.display.background_color"];
|
||||
[self clearPref:"browser.display.foreground_color"];
|
||||
[self clearPref:"browser.anchor_color"];
|
||||
[self clearPref:"browser.visited_color"];
|
||||
[self clearPref:kGeckoPrefUnderlineLinks];
|
||||
[self clearPref:kGeckoPrefUsePageColors];
|
||||
[self clearPref:kGeckoPrefPageBackgroundColor];
|
||||
[self clearPref:kGeckoPrefPageForegroundColor];
|
||||
[self clearPref:kGeckoPrefLinkColor];
|
||||
[self clearPref:kGeckoPrefVisitedLinkColor];
|
||||
|
||||
// update the UI of the Appearance pane
|
||||
int state;
|
||||
state = [self getBooleanPref:"browser.underline_anchors" withSuccess:NULL] ? NSOnState : NSOffState;
|
||||
state = [self getBooleanPref:kGeckoPrefUnderlineLinks withSuccess:NULL] ? NSOnState : NSOffState;
|
||||
[mUnderlineLinksCheckbox setState:state];
|
||||
state = [self getBooleanPref:"browser.display.use_document_colors" withSuccess:NULL] ? NSOffState : NSOnState;
|
||||
state = [self getBooleanPref:kGeckoPrefUsePageColors withSuccess:NULL] ? NSOffState : NSOnState;
|
||||
[mUseMyColorsCheckbox setState:state];
|
||||
|
||||
[mBackgroundColorWell setColor:[self getColorPref:"browser.display.background_color" withSuccess:NULL]];
|
||||
[mTextColorWell setColor:[self getColorPref:"browser.display.foreground_color" withSuccess:NULL]];
|
||||
[mUnvisitedLinksColorWell setColor:[self getColorPref:"browser.anchor_color" withSuccess:NULL]];
|
||||
[mVisitedLinksColorWell setColor:[self getColorPref:"browser.visited_color" withSuccess:NULL]];
|
||||
[mBackgroundColorWell setColor:[self getColorPref:kGeckoPrefPageBackgroundColor withSuccess:NULL]];
|
||||
[mTextColorWell setColor:[self getColorPref:kGeckoPrefPageForegroundColor withSuccess:NULL]];
|
||||
[mUnvisitedLinksColorWell setColor:[self getColorPref:kGeckoPrefLinkColor withSuccess:NULL]];
|
||||
[mVisitedLinksColorWell setColor:[self getColorPref:kGeckoPrefVisitedLinkColor withSuccess:NULL]];
|
||||
}
|
||||
|
||||
// Reset the Fonts tab to application factory defaults.
|
||||
|
@ -767,7 +769,7 @@ const int kDefaultFontSansSerifTag = 1;
|
|||
[regionDict setObject:[NSMutableDictionary dictionary] forKey:@"defaultFontType"];
|
||||
}
|
||||
|
||||
[self clearPref:"browser.display.use_document_fonts"];
|
||||
[self clearPref:kGeckoPrefUsePageFonts];
|
||||
|
||||
// commit the changes
|
||||
// first, we clear the preferences by saving them. This clears the values that are returned by
|
||||
|
|
|
@ -38,11 +38,10 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#import <Carbon/Carbon.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#import "Downloads.h"
|
||||
|
||||
#import "GeckoPrefConstants.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsILocalFileMac.h"
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
|
@ -102,11 +101,10 @@ private:
|
|||
if (!mPrefService)
|
||||
return;
|
||||
|
||||
BOOL gotPref;
|
||||
|
||||
[mAutoCloseDLManager setState:![self getBooleanPref:"browser.download.progressDnldDialog.keepAlive" withSuccess:&gotPref]];
|
||||
[mEnableHelperApps setState:[self getBooleanPref:"browser.download.autoDispatch" withSuccess:&gotPref]];
|
||||
[mDownloadRemovalPolicy selectItem:[[mDownloadRemovalPolicy menu] itemWithTag:[self getIntPref:"browser.download.downloadRemoveAction" withSuccess:&gotPref]]];
|
||||
[mAutoCloseDLManager setState:![self getBooleanPref:kGeckoPrefLeaveDownloadManagerOpen withSuccess:NULL]];
|
||||
[mEnableHelperApps setState:[self getBooleanPref:kGeckoPrefAutoOpenDownloads withSuccess:NULL]];
|
||||
[mDownloadRemovalPolicy selectItem:[[mDownloadRemovalPolicy menu] itemWithTag:[self getIntPref:kGeckoPrefDownloadCleanupPolicy
|
||||
withSuccess:NULL]]];
|
||||
|
||||
NSString* downloadFolderDesc = [self downloadFolderDescription];
|
||||
if ([downloadFolderDesc length] == 0)
|
||||
|
@ -123,10 +121,10 @@ private:
|
|||
return;
|
||||
|
||||
if (sender == mAutoCloseDLManager) {
|
||||
[self setPref:"browser.download.progressDnldDialog.keepAlive" toBoolean:![sender state]];
|
||||
[self setPref:kGeckoPrefLeaveDownloadManagerOpen toBoolean:![sender state]];
|
||||
}
|
||||
if (sender == mEnableHelperApps) {
|
||||
[self setPref:"browser.download.autoDispatch" toBoolean:[sender state]];
|
||||
[self setPref:kGeckoPrefAutoOpenDownloads toBoolean:[sender state]];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -240,7 +238,7 @@ private:
|
|||
// The three options in the popup contains tags 0-2, set the pref according to the
|
||||
// selected menu item's tag.
|
||||
int selectedTagValue = [mDownloadRemovalPolicy selectedTag];
|
||||
[self setPref:"browser.download.downloadRemoveAction" toInt:selectedTagValue];
|
||||
[self setPref:kGeckoPrefDownloadCleanupPolicy toInt:selectedTagValue];
|
||||
}
|
||||
|
||||
// called when the user closes the open panel sheet for selecting a new d/l folder.
|
||||
|
|
|
@ -38,23 +38,16 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <ApplicationServices/ApplicationServices.h>
|
||||
#import <Sparkle/Sparkle.h>
|
||||
|
||||
#import "NSWorkspace+Utils.h"
|
||||
#import "AppListMenuFactory.h"
|
||||
#import "UserDefaults.h"
|
||||
#import "GeckoPrefConstants.h"
|
||||
|
||||
#import "General.h"
|
||||
|
||||
static const char kHomepagePrefName[] = "browser.startup.homepage";
|
||||
static const char kNewPageActionPrefName[] = "browser.startup.page";
|
||||
static const char kNewTabActionPrefName[] = "browser.tabs.startPage";
|
||||
static const char kCheckDefaultBrowserPrefName[] = "camino.check_default_browser";
|
||||
static const char kWarnWhenClosingPrefName[] = "camino.warn_when_closing";
|
||||
static const char kRememberWindowStatePrefName[] = "camino.remember_window_state";
|
||||
|
||||
@interface OrgMozillaCaminoPreferenceGeneral(Private)
|
||||
|
||||
- (NSString*)currentHomePage;
|
||||
|
@ -90,21 +83,20 @@ static const char kRememberWindowStatePrefName[] = "camino.remember_window_state
|
|||
|
||||
BOOL gotPref;
|
||||
|
||||
// 0: blank page. 1: home page. 2: last page visited. Our behaviour here should
|
||||
// match what the browser does when the prefs don't exist.
|
||||
if (([self getIntPref:kNewPageActionPrefName withSuccess:&gotPref] == 1) || !gotPref)
|
||||
// Our behaviour here should match what the browser does when the prefs don't exist.
|
||||
if (([self getIntPref:kGeckoPrefNewWindowStartPage withSuccess:&gotPref] == kStartPageHome) || !gotPref)
|
||||
[checkboxNewWindowBlank setState:NSOnState];
|
||||
|
||||
if (([self getIntPref:kNewTabActionPrefName withSuccess:&gotPref] == 1))
|
||||
if (([self getIntPref:kGeckoPrefNewTabStartPage withSuccess:&gotPref] == kStartPageHome))
|
||||
[checkboxNewTabBlank setState:NSOnState];
|
||||
|
||||
if ([self getBooleanPref:kCheckDefaultBrowserPrefName withSuccess:&gotPref] || !gotPref)
|
||||
if ([self getBooleanPref:kGeckoPrefCheckDefaultBrowserAtLaunch withSuccess:&gotPref] || !gotPref)
|
||||
[checkboxCheckDefaultBrowserOnLaunch setState:NSOnState];
|
||||
|
||||
if ([self getBooleanPref:kWarnWhenClosingPrefName withSuccess:&gotPref])
|
||||
if ([self getBooleanPref:kGeckoPrefWarnWhenClosingWindows withSuccess:&gotPref])
|
||||
[checkboxWarnWhenClosing setState:NSOnState];
|
||||
|
||||
if ([self getBooleanPref:kRememberWindowStatePrefName withSuccess:&gotPref])
|
||||
if ([self getBooleanPref:kGeckoPrefSessionSaveEnabled withSuccess:&gotPref])
|
||||
[checkboxRememberWindowState setState:NSOnState];
|
||||
|
||||
if ([[[NSUserDefaults standardUserDefaults] stringForKey:SUFeedURLKey] length] == 0) {
|
||||
|
@ -137,11 +129,11 @@ static const char kRememberWindowStatePrefName[] = "camino.remember_window_state
|
|||
if (!mPrefService)
|
||||
return;
|
||||
|
||||
[self setPref:kHomepagePrefName toString:[textFieldHomePage stringValue]];
|
||||
[self setPref:kGeckoPrefHomepageURL toString:[textFieldHomePage stringValue]];
|
||||
|
||||
// ensure that the prefs exist
|
||||
[self setPref:kNewPageActionPrefName toInt:[checkboxNewWindowBlank state] ? 1 : 0];
|
||||
[self setPref:kNewTabActionPrefName toInt:[checkboxNewTabBlank state] ? 1 : 0];
|
||||
[self setPref:kGeckoPrefNewWindowStartPage toInt:[checkboxNewWindowBlank state] ? kStartPageHome : kStartPageBlank];
|
||||
[self setPref:kGeckoPrefNewTabStartPage toInt:[checkboxNewTabBlank state] ? kStartPageHome : kStartPageBlank];
|
||||
}
|
||||
|
||||
- (IBAction)checkboxStartPageClicked:(id)sender
|
||||
|
@ -151,30 +143,30 @@ static const char kRememberWindowStatePrefName[] = "camino.remember_window_state
|
|||
|
||||
const char* prefName = NULL;
|
||||
if (sender == checkboxNewTabBlank)
|
||||
prefName = kNewTabActionPrefName;
|
||||
prefName = kGeckoPrefNewTabStartPage;
|
||||
else if (sender == checkboxNewWindowBlank)
|
||||
prefName = kNewPageActionPrefName;
|
||||
prefName = kGeckoPrefNewWindowStartPage;
|
||||
|
||||
if (prefName)
|
||||
[self setPref:prefName toInt: [sender state] ? 1 : 0];
|
||||
[self setPref:prefName toInt: [sender state] ? kStartPageHome : kStartPageBlank];
|
||||
}
|
||||
|
||||
- (IBAction)warningCheckboxClicked:(id)sender
|
||||
{
|
||||
if (sender == checkboxWarnWhenClosing)
|
||||
[self setPref:kWarnWhenClosingPrefName toBoolean:([sender state] == NSOnState)];
|
||||
[self setPref:kGeckoPrefWarnWhenClosingWindows toBoolean:([sender state] == NSOnState)];
|
||||
}
|
||||
|
||||
- (IBAction)rememberWindowStateCheckboxClicked:(id)sender
|
||||
{
|
||||
if (sender == checkboxRememberWindowState)
|
||||
[self setPref:kRememberWindowStatePrefName toBoolean:([sender state] == NSOnState)];
|
||||
[self setPref:kGeckoPrefSessionSaveEnabled toBoolean:([sender state] == NSOnState)];
|
||||
}
|
||||
|
||||
- (IBAction)checkDefaultBrowserOnLaunchClicked:(id)sender
|
||||
{
|
||||
if (sender == checkboxCheckDefaultBrowserOnLaunch)
|
||||
[self setPref:kCheckDefaultBrowserPrefName toBoolean:([sender state] == NSOnState)];
|
||||
[self setPref:kGeckoPrefCheckDefaultBrowserAtLaunch toBoolean:([sender state] == NSOnState)];
|
||||
}
|
||||
|
||||
- (IBAction)autoUpdateCheckboxClicked:(id)sender
|
||||
|
@ -194,7 +186,7 @@ static const char kRememberWindowStatePrefName[] = "camino.remember_window_state
|
|||
- (NSString*)currentHomePage
|
||||
{
|
||||
BOOL gotPref;
|
||||
return [self getStringPref:kHomepagePrefName withSuccess:&gotPref];
|
||||
return [self getStringPref:kGeckoPrefHomepageURL withSuccess:&gotPref];
|
||||
}
|
||||
|
||||
// called when the users changes the selection in the default browser menu
|
||||
|
|
|
@ -41,6 +41,8 @@
|
|||
#import "History.h"
|
||||
#import "NSString+Utils.h"
|
||||
|
||||
#import "GeckoPrefConstants.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIBrowserHistory.h"
|
||||
|
@ -86,7 +88,7 @@ static const int kDefaultExpireDays = 9;
|
|||
- (void)mainViewDidLoad
|
||||
{
|
||||
BOOL gotPref;
|
||||
int expireDays = [self getIntPref:"browser.history_expire_days" withSuccess:&gotPref];
|
||||
int expireDays = [self getIntPref:kGeckoPrefHistoryLifetimeDays withSuccess:&gotPref];
|
||||
if (!gotPref)
|
||||
expireDays = kDefaultExpireDays;
|
||||
|
||||
|
@ -96,12 +98,12 @@ static const int kDefaultExpireDays = 9;
|
|||
|
||||
- (void)didUnselect
|
||||
{
|
||||
[self setPref:"browser.history_expire_days" toInt:[textFieldHistoryDays intValue]];
|
||||
[self setPref:kGeckoPrefHistoryLifetimeDays toInt:[textFieldHistoryDays intValue]];
|
||||
}
|
||||
|
||||
- (IBAction)historyDaysModified:(id)sender
|
||||
{
|
||||
[self setPref:"browser.history_expire_days" toInt:[sender intValue]];
|
||||
[self setPref:kGeckoPrefHistoryLifetimeDays toInt:[sender intValue]];
|
||||
}
|
||||
|
||||
// Clear the user's disk cache
|
||||
|
|
|
@ -42,15 +42,6 @@
|
|||
|
||||
@class ExtendedTableView;
|
||||
|
||||
// network.cookie.cookieBehavior settings
|
||||
// these are the defaults, overriden by whitelist/blacklist
|
||||
typedef enum ECookieBehaviorSettings
|
||||
{
|
||||
eAcceptAllCookies,
|
||||
eAcceptCookiesFromOriginatingServer,
|
||||
eDenyAllCookies
|
||||
} ECookieBehaviorSettings;
|
||||
|
||||
// for the "Policy" column in the Exceptions List
|
||||
typedef enum ECookiePolicyPopupIndex
|
||||
{
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#import "CHPermissionManager.h"
|
||||
#import "ExtendedTableView.h"
|
||||
#import "KeychainDenyList.h"
|
||||
#import "GeckoPrefConstants.h"
|
||||
|
||||
@interface CookieDateFormatter : NSDateFormatter
|
||||
@end
|
||||
|
@ -50,10 +51,6 @@
|
|||
// prefs for keychain password autofill
|
||||
static const char* const kUseKeychainPref = "chimera.store_passwords_with_keychain";
|
||||
|
||||
// network.cookie.lifetimePolicy settings
|
||||
const int kAcceptCookiesNormally = 0;
|
||||
const int kWarnAboutCookies = 1;
|
||||
|
||||
// sort order indicators
|
||||
const int kSortReverse = 1;
|
||||
|
||||
|
@ -139,20 +136,20 @@ const int kSortReverse = 1;
|
|||
{
|
||||
// Hook up cookie prefs.
|
||||
BOOL gotPref = NO;
|
||||
int acceptCookies = [self getIntPref:"network.cookie.cookieBehavior"
|
||||
int acceptCookies = [self getIntPref:kGeckoPrefCookieDefaultAcceptPolicy
|
||||
withSuccess:&gotPref];
|
||||
if (!gotPref)
|
||||
acceptCookies = eAcceptAllCookies;
|
||||
acceptCookies = kCookieAcceptAll;
|
||||
[self mapCookiePrefToGUI:acceptCookies];
|
||||
|
||||
// lifetimePolicy now controls asking about cookies, despite being totally unintuitive
|
||||
int lifetimePolicy = [self getIntPref:"network.cookie.lifetimePolicy"
|
||||
int lifetimePolicy = [self getIntPref:kGeckoPrefCookieLifetimePolicy
|
||||
withSuccess:&gotPref];
|
||||
if (!gotPref)
|
||||
lifetimePolicy = kAcceptCookiesNormally;
|
||||
if (lifetimePolicy == kWarnAboutCookies)
|
||||
lifetimePolicy = kCookieLifetimeNormal;
|
||||
if (lifetimePolicy == kCookieLifetimeAsk)
|
||||
[mAskAboutCookies setState:NSOnState];
|
||||
else if (lifetimePolicy == kAcceptCookiesNormally)
|
||||
else if (lifetimePolicy == kCookieLifetimeNormal)
|
||||
[mAskAboutCookies setState:NSOffState];
|
||||
else
|
||||
[mAskAboutCookies setState:NSMixedState];
|
||||
|
@ -174,16 +171,16 @@ const int kSortReverse = 1;
|
|||
- (IBAction)clickCookieBehavior:(id)sender
|
||||
{
|
||||
int row = [mCookieBehavior selectedRow];
|
||||
[self setPref:"network.cookie.cookieBehavior" toInt:row];
|
||||
[self setPref:kGeckoPrefCookieDefaultAcceptPolicy toInt:row];
|
||||
[self mapCookiePrefToGUI:row];
|
||||
}
|
||||
|
||||
- (IBAction)clickAskAboutCookies:(id)sender
|
||||
{
|
||||
[sender setAllowsMixedState:NO];
|
||||
[self setPref:"network.cookie.lifetimePolicy"
|
||||
toInt:([sender state] == NSOnState) ? kWarnAboutCookies
|
||||
: kAcceptCookiesNormally];
|
||||
[self setPref:kGeckoPrefCookieLifetimePolicy
|
||||
toInt:([sender state] == NSOnState) ? kCookieLifetimeAsk
|
||||
: kCookieLifetimeNormal];
|
||||
}
|
||||
|
||||
- (IBAction)clickStorePasswords:(id)sender
|
||||
|
@ -207,8 +204,8 @@ const int kSortReverse = 1;
|
|||
- (void)mapCookiePrefToGUI:(int)pref
|
||||
{
|
||||
[mCookieBehavior selectCellWithTag:pref];
|
||||
[mAskAboutCookies setEnabled:(pref == eAcceptAllCookies ||
|
||||
pref == eAcceptCookiesFromOriginatingServer)];
|
||||
[mAskAboutCookies setEnabled:(pref == kCookieAcceptAll ||
|
||||
pref == kCookieAcceptFromOriginatingServer)];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
|
||||
#import "SecurityPane.h"
|
||||
|
||||
#import "GeckoPrefConstants.h"
|
||||
|
||||
// prefs for showing security dialogs
|
||||
#define LEAVE_SITE_PREF "security.warn_leaving_secure"
|
||||
#define MIXEDCONTENT_PREF "security.warn_viewing_mixed"
|
||||
|
@ -61,12 +63,12 @@ const unsigned int kAskEveryTimeMatrixRowValue = 1;
|
|||
[mViewMixed setState:(viewMixed ? NSOnState : NSOffState)];
|
||||
|
||||
BOOL gotPref;
|
||||
NSString* certificateBehavior = [self getStringPref:"security.default_personal_cert"
|
||||
NSString* certificateBehavior = [self getStringPref:kGeckoPrefDefaultCertificateBehavior
|
||||
withSuccess:&gotPref];
|
||||
if (gotPref) {
|
||||
if ([certificateBehavior isEqual:@"Select Automatically"])
|
||||
if ([certificateBehavior isEqual:kPersonalCertificateSelectAutomatically])
|
||||
[mCertificateBehavior selectCellAtRow:kSelectAutomaticallyMatrixRowValue column:0];
|
||||
else if ([certificateBehavior isEqual:@"Ask Every Time"])
|
||||
else if ([certificateBehavior isEqual:kPersonalCertificateAlwaysAsk])
|
||||
[mCertificateBehavior selectCellAtRow:kAskEveryTimeMatrixRowValue column:0];
|
||||
}
|
||||
|
||||
|
@ -108,9 +110,9 @@ const unsigned int kAskEveryTimeMatrixRowValue = 1;
|
|||
unsigned int row = [mCertificateBehavior selectedRow];
|
||||
|
||||
if (row == kSelectAutomaticallyMatrixRowValue)
|
||||
[self setPref:"security.default_personal_cert" toString:@"Select Automatically"];
|
||||
[self setPref:kGeckoPrefDefaultCertificateBehavior toString:kPersonalCertificateSelectAutomatically];
|
||||
else // row == kAskEveryTimeMatrixRowValue
|
||||
[self setPref:"security.default_personal_cert" toString:@"Ask Every Time"];
|
||||
[self setPref:kGeckoPrefDefaultCertificateBehavior toString:kPersonalCertificateAlwaysAsk];
|
||||
}
|
||||
|
||||
- (IBAction)showCertificates:(id)sender
|
||||
|
|
|
@ -39,10 +39,8 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#import "Tabs.h"
|
||||
#import "nsIBrowserDOMWindow.h"
|
||||
|
||||
const int kOpenExternalLinksInNewWindow = 0;
|
||||
const int kOpenExternalLinksInNewTab = 1;
|
||||
#import "GeckoPrefConstants.h"
|
||||
|
||||
@implementation OrgMozillaCaminoPreferenceTabs
|
||||
|
||||
|
@ -64,26 +62,28 @@ const int kOpenExternalLinksInNewTab = 1;
|
|||
|
||||
BOOL gotPref;
|
||||
|
||||
[mCheckboxOpenTabsForCommand setState:([self getBooleanPref:"browser.tabs.opentabfor.middleclick" withSuccess:&gotPref] ? NSOnState : NSOffState)];
|
||||
[mCheckboxOpenTabsForCommand setState:([self getBooleanPref:kGeckoPrefOpenTabsForMiddleClick
|
||||
withSuccess:&gotPref] ? NSOnState : NSOffState)];
|
||||
|
||||
int externalLinksPref = [self getIntPref:"browser.reuse_window" withSuccess:&gotPref];
|
||||
if (externalLinksPref == kOpenExternalLinksInNewWindow)
|
||||
int externalLinksPref = [self getIntPref:kGeckoPrefExternalLoadBehavior withSuccess:&gotPref];
|
||||
if (externalLinksPref == kExternalLoadOpensNewWindow)
|
||||
[mCheckboxOpenTabsForExternalLinks setState:NSOffState];
|
||||
else if (externalLinksPref == kOpenExternalLinksInNewTab)
|
||||
else if (externalLinksPref == kExternalLoadOpensNewTab)
|
||||
[mCheckboxOpenTabsForExternalLinks setState:NSOnState];
|
||||
else
|
||||
[mCheckboxOpenTabsForExternalLinks setState:NSMixedState];
|
||||
|
||||
int swmBehavior = [self getIntPref:"browser.link.open_newwindow" withSuccess:&gotPref];
|
||||
if (swmBehavior == nsIBrowserDOMWindow::OPEN_NEWWINDOW)
|
||||
int swmBehavior = [self getIntPref:kGeckoPrefSingleWindowModeTargetBehavior withSuccess:&gotPref];
|
||||
if (swmBehavior == kSingleWindowModeUseNewWindow)
|
||||
[mSingleWindowMode setState:NSOffState];
|
||||
else if (swmBehavior == nsIBrowserDOMWindow::OPEN_NEWTAB)
|
||||
else if (swmBehavior == kSingleWindowModeUseNewTab)
|
||||
[mSingleWindowMode setState:NSOnState];
|
||||
else
|
||||
[mSingleWindowMode setState:NSMixedState];
|
||||
|
||||
[mCheckboxLoadTabsInBackground setState:([self getBooleanPref:"browser.tabs.loadInBackground" withSuccess:&gotPref] ? NSOnState : NSOffState)];
|
||||
[mTabBarVisiblity setState:([self getBooleanPref:"camino.tab_bar_always_visible" withSuccess:&gotPref] ? NSOnState : NSOffState)];
|
||||
[mCheckboxLoadTabsInBackground setState:([self getBooleanPref:kGeckoPrefOpenTabsInBackground
|
||||
withSuccess:&gotPref] ? NSOnState : NSOffState)];
|
||||
[mTabBarVisiblity setState:([self getBooleanPref:kGeckoPrefAlwaysShowTabBar withSuccess:&gotPref] ? NSOnState : NSOffState)];
|
||||
}
|
||||
|
||||
- (IBAction)checkboxClicked:(id)sender
|
||||
|
@ -92,22 +92,23 @@ const int kOpenExternalLinksInNewTab = 1;
|
|||
return;
|
||||
|
||||
if (sender == mCheckboxOpenTabsForCommand)
|
||||
[self setPref:"browser.tabs.opentabfor.middleclick" toBoolean:([sender state] == NSOnState)];
|
||||
[self setPref:kGeckoPrefOpenTabsForMiddleClick toBoolean:([sender state] == NSOnState)];
|
||||
else if (sender == mCheckboxOpenTabsForExternalLinks) {
|
||||
[sender setAllowsMixedState:NO];
|
||||
[self setPref:"browser.reuse_window" toInt:([sender state] == NSOnState ? kOpenExternalLinksInNewTab : kOpenExternalLinksInNewWindow)];
|
||||
[self setPref:kGeckoPrefExternalLoadBehavior toInt:([sender state] == NSOnState ? kExternalLoadOpensNewTab
|
||||
: kExternalLoadOpensNewWindow)];
|
||||
}
|
||||
else if (sender == mSingleWindowMode) {
|
||||
[sender setAllowsMixedState:NO];
|
||||
// Cast to avoid "enumeral mismatch" warning - thanks a lot, xpidl.
|
||||
int newState = ([sender state] == NSOnState) ? (int)nsIBrowserDOMWindow::OPEN_NEWTAB : (int)nsIBrowserDOMWindow::OPEN_NEWWINDOW;
|
||||
[self setPref:"browser.link.open_newwindow" toInt:newState];
|
||||
int newState = ([sender state] == NSOnState) ? kSingleWindowModeUseNewTab
|
||||
: kSingleWindowModeUseNewWindow;
|
||||
[self setPref:kGeckoPrefSingleWindowModeTargetBehavior toInt:newState];
|
||||
}
|
||||
|
||||
else if (sender == mCheckboxLoadTabsInBackground)
|
||||
[self setPref:"browser.tabs.loadInBackground" toBoolean:([sender state] == NSOnState)];
|
||||
[self setPref:kGeckoPrefOpenTabsInBackground toBoolean:([sender state] == NSOnState)];
|
||||
else if (sender == mTabBarVisiblity)
|
||||
[self setPref:"camino.tab_bar_always_visible" toBoolean:([sender state] == NSOnState)];
|
||||
[self setPref:kGeckoPrefAlwaysShowTabBar toBoolean:([sender state] == NSOnState)];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -44,16 +44,12 @@
|
|||
#import "NSString+Utils.h"
|
||||
#import "CHPermissionManager.h"
|
||||
#import "ExtendedTableView.h"
|
||||
#import "GeckoPrefConstants.h"
|
||||
|
||||
// need to match the strings in PreferenceManager.mm
|
||||
static NSString* const AdBlockingChangedNotificationName = @"AdBlockingChanged";
|
||||
static NSString* const kFlashBlockChangedNotificationName = @"FlashBlockChanged";
|
||||
|
||||
// for accessibility.tabfocus
|
||||
const int kFocusTextFields = (1 << 0);
|
||||
const int kFocusForms = (1 << 1);
|
||||
const int kFocusLinks = (1 << 2);
|
||||
|
||||
// for annoyance blocker prefs
|
||||
const int kAnnoyancePrefNone = 1;
|
||||
const int kAnnoyancePrefAll = 2;
|
||||
|
@ -87,18 +83,18 @@ const int kAnnoyancePrefSome = 3;
|
|||
BOOL gotPref = NO;
|
||||
|
||||
// Set initial value on JavaScript checkbox.
|
||||
BOOL jsEnabled = [self getBooleanPref:"javascript.enabled" withSuccess:&gotPref] && gotPref;
|
||||
BOOL jsEnabled = [self getBooleanPref:kGeckoPrefEnableJavascript withSuccess:&gotPref] && gotPref;
|
||||
[mEnableJS setState:jsEnabled];
|
||||
|
||||
// Set initial value on Java checkbox, and disable it if plugins are off
|
||||
BOOL pluginsEnabled = [self getBooleanPref:"camino.enable_plugins" withSuccess:&gotPref] || !gotPref;
|
||||
BOOL pluginsEnabled = [self getBooleanPref:kGeckoPrefEnablePlugins withSuccess:&gotPref] || !gotPref;
|
||||
[mEnableJava setEnabled:pluginsEnabled];
|
||||
BOOL javaEnabled = pluginsEnabled && [self getBooleanPref:"security.enable_java" withSuccess:NULL];
|
||||
BOOL javaEnabled = pluginsEnabled && [self getBooleanPref:kGeckoPrefEnableJava withSuccess:NULL];
|
||||
[mEnableJava setState:javaEnabled];
|
||||
|
||||
// set initial value on popup blocking checkbox and disable the whitelist
|
||||
// button if it's off
|
||||
BOOL enablePopupBlocking = [self getBooleanPref:"dom.disable_open_during_load" withSuccess:&gotPref] && gotPref;
|
||||
BOOL enablePopupBlocking = [self getBooleanPref:kGeckoPrefBlockPopups withSuccess:&gotPref] && gotPref;
|
||||
[mEnablePopupBlocking setState:enablePopupBlocking];
|
||||
[mEditWhitelist setEnabled:enablePopupBlocking];
|
||||
|
||||
|
@ -112,7 +108,7 @@ const int kAnnoyancePrefSome = 3;
|
|||
|
||||
[mPreventAnimation setState:[self preventAnimationCheckboxState]];
|
||||
|
||||
BOOL enableAdBlock = [self getBooleanPref:"camino.enable_ad_blocking" withSuccess:&gotPref];
|
||||
BOOL enableAdBlock = [self getBooleanPref:kGeckoPrefBlockAds withSuccess:&gotPref];
|
||||
[mEnableAdBlocking setState:enableAdBlock];
|
||||
|
||||
// Only allow FlashBlock if dependencies are set correctly
|
||||
|
@ -120,7 +116,7 @@ const int kAnnoyancePrefSome = 3;
|
|||
[mEnableFlashBlock setEnabled:flashBlockAllowed];
|
||||
|
||||
if (flashBlockAllowed) {
|
||||
BOOL enableFlashBlock = [self getBooleanPref:"camino.enable_flashblock" withSuccess:nil];
|
||||
BOOL enableFlashBlock = [self getBooleanPref:kGeckoPrefBlockFlash withSuccess:NULL];
|
||||
[mEnableFlashBlock setState:(enableFlashBlock ? NSOnState : NSOffState)];
|
||||
}
|
||||
|
||||
|
@ -143,7 +139,7 @@ const int kAnnoyancePrefSome = 3;
|
|||
//
|
||||
-(IBAction) clickEnableJS:(id)sender
|
||||
{
|
||||
[self setPref:"javascript.enabled" toBoolean:([sender state] == NSOnState)];
|
||||
[self setPref:kGeckoPrefEnableJavascript toBoolean:([sender state] == NSOnState)];
|
||||
|
||||
// FlashBlock depends on Javascript so make sure to update the FlashBlock settings
|
||||
[self updateFlashBlock];
|
||||
|
@ -156,7 +152,7 @@ const int kAnnoyancePrefSome = 3;
|
|||
//
|
||||
-(IBAction) clickEnableJava:(id)sender
|
||||
{
|
||||
[self setPref:"security.enable_java" toBoolean:([sender state] == NSOnState)];
|
||||
[self setPref:kGeckoPrefEnableJava toBoolean:([sender state] == NSOnState)];
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -167,7 +163,7 @@ const int kAnnoyancePrefSome = 3;
|
|||
//
|
||||
- (IBAction)clickEnableAdBlocking:(id)sender
|
||||
{
|
||||
[self setPref:"camino.enable_ad_blocking" toBoolean:([sender state] == NSOnState)];
|
||||
[self setPref:kGeckoPrefBlockAds toBoolean:([sender state] == NSOnState)];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:AdBlockingChangedNotificationName object:nil];
|
||||
}
|
||||
|
||||
|
@ -179,7 +175,7 @@ const int kAnnoyancePrefSome = 3;
|
|||
//
|
||||
- (IBAction)clickEnablePopupBlocking:(id)sender
|
||||
{
|
||||
[self setPref:"dom.disable_open_during_load" toBoolean:([sender state] == NSOnState)];
|
||||
[self setPref:kGeckoPrefBlockPopups toBoolean:([sender state] == NSOnState)];
|
||||
[mEditWhitelist setEnabled:[sender state]];
|
||||
}
|
||||
|
||||
|
@ -191,7 +187,8 @@ const int kAnnoyancePrefSome = 3;
|
|||
-(IBAction) clickPreventAnimation:(id)sender
|
||||
{
|
||||
[sender setAllowsMixedState:NO];
|
||||
[self setPref:"image.animation_mode" toString:([sender state] ? @"once" : @"normal")];
|
||||
[self setPref:kGeckoPrefImageAnimationBehavior
|
||||
toString:([sender state] ? kImageAnimationOnce : kImageAnimationLoop)];
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -202,7 +199,7 @@ const int kAnnoyancePrefSome = 3;
|
|||
//
|
||||
-(IBAction) clickEnableFlashBlock:(id)sender
|
||||
{
|
||||
[self setPref:"camino.enable_flashblock" toBoolean:([sender state] == NSOnState)];
|
||||
[self setPref:kGeckoPrefBlockFlash toBoolean:([sender state] == NSOnState)];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kFlashBlockChangedNotificationName object:nil];
|
||||
}
|
||||
|
||||
|
@ -356,27 +353,25 @@ const int kAnnoyancePrefSome = 3;
|
|||
// tabFocusBehaviorChanged:
|
||||
//
|
||||
// Enable and disable tabbing to various elements. We expose only three options,
|
||||
// but internally it's a bitwise additive pref:
|
||||
// bit 0 adds focus for text fields (kFocusTextFields)
|
||||
// bit 1 adds focus for other form elements (kFocusForms)
|
||||
// bit 2 adds links and linked images (kFocusLinks)
|
||||
// but internally it's a bitwise additive pref of text fields, other form
|
||||
// elements, and links
|
||||
//
|
||||
- (IBAction)tabFocusBehaviorChanged:(id)sender
|
||||
{
|
||||
int tabFocusValue = 0;
|
||||
switch ([sender indexOfSelectedItem]) {
|
||||
case 0:
|
||||
tabFocusValue = kFocusTextFields;
|
||||
tabFocusValue = kTabFocusesTextFields;
|
||||
break;
|
||||
case 1:
|
||||
tabFocusValue = kFocusTextFields | kFocusForms;
|
||||
tabFocusValue = kTabFocusesTextFields | kTabFocusesForms;
|
||||
break;
|
||||
case 2:
|
||||
tabFocusValue = kFocusTextFields | kFocusForms | kFocusLinks;
|
||||
tabFocusValue = kTabFocusesTextFields | kTabFocusesForms | kTabFocusesLinks;
|
||||
break;
|
||||
}
|
||||
|
||||
[self setPref:"accessibility.tabfocus" toInt:tabFocusValue];
|
||||
[self setPref:kGeckoPrefTabFocusBehavior toInt:tabFocusValue];
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -387,10 +382,10 @@ const int kAnnoyancePrefSome = 3;
|
|||
// of showing an over-inclusive item.
|
||||
//
|
||||
- (int)popupIndexForCurrentTabFocusPref {
|
||||
int tabFocusValue = [self getIntPref:"accessibility.tabfocus" withSuccess:NULL];
|
||||
if (tabFocusValue & kFocusLinks)
|
||||
int tabFocusValue = [self getIntPref:kGeckoPrefTabFocusBehavior withSuccess:NULL];
|
||||
if (tabFocusValue & kTabFocusesLinks)
|
||||
return 2;
|
||||
else if (tabFocusValue & kFocusForms)
|
||||
else if (tabFocusValue & kTabFocusesForms)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
|
@ -419,16 +414,16 @@ const int kAnnoyancePrefSome = 3;
|
|||
//
|
||||
-(void) setAnnoyingWindowPrefsTo:(BOOL)inValue
|
||||
{
|
||||
[self setPref:"dom.disable_window_move_resize" toBoolean:inValue];
|
||||
[self setPref:"dom.disable_window_status_change" toBoolean:inValue];
|
||||
[self setPref:"dom.disable_window_flip" toBoolean:inValue];
|
||||
[self setPref:kGeckoPrefPreventDOMWindowResize toBoolean:inValue];
|
||||
[self setPref:kGeckoPrefPreventDOMStatusChange toBoolean:inValue];
|
||||
[self setPref:kGeckoPrefPreventDOMWindowFocus toBoolean:inValue];
|
||||
}
|
||||
|
||||
- (int)annoyingWindowPrefs
|
||||
{
|
||||
BOOL disableStatusChangePref = [self getBooleanPref:"dom.disable_window_status_change" withSuccess:NULL];
|
||||
BOOL disableMoveResizePref = [self getBooleanPref:"dom.disable_window_move_resize" withSuccess:NULL];
|
||||
BOOL disableWindowFlipPref = [self getBooleanPref:"dom.disable_window_flip" withSuccess:NULL];
|
||||
BOOL disableStatusChangePref = [self getBooleanPref:kGeckoPrefPreventDOMStatusChange withSuccess:NULL];
|
||||
BOOL disableMoveResizePref = [self getBooleanPref:kGeckoPrefPreventDOMWindowResize withSuccess:NULL];
|
||||
BOOL disableWindowFlipPref = [self getBooleanPref:kGeckoPrefPreventDOMWindowFocus withSuccess:NULL];
|
||||
|
||||
if(disableStatusChangePref && disableMoveResizePref && disableWindowFlipPref)
|
||||
return kAnnoyancePrefAll;
|
||||
|
@ -440,10 +435,10 @@ const int kAnnoyancePrefSome = 3;
|
|||
|
||||
- (int)preventAnimationCheckboxState
|
||||
{
|
||||
NSString* preventAnimation = [self getStringPref:"image.animation_mode" withSuccess:NULL];
|
||||
if ([preventAnimation isEqualToString:@"once"])
|
||||
NSString* preventAnimation = [self getStringPref:kGeckoPrefImageAnimationBehavior withSuccess:NULL];
|
||||
if ([preventAnimation isEqualToString:kImageAnimationOnce])
|
||||
return NSOnState;
|
||||
else if ([preventAnimation isEqualToString:@"normal"])
|
||||
else if ([preventAnimation isEqualToString:kImageAnimationLoop])
|
||||
return NSOffState;
|
||||
else
|
||||
return NSMixedState;
|
||||
|
@ -460,8 +455,8 @@ const int kAnnoyancePrefSome = 3;
|
|||
-(BOOL) isFlashBlockAllowed
|
||||
{
|
||||
BOOL gotPref = NO;
|
||||
BOOL jsEnabled = [self getBooleanPref:"javascript.enabled" withSuccess:&gotPref] && gotPref;
|
||||
BOOL pluginsEnabled = [self getBooleanPref:"camino.enable_plugins" withSuccess:&gotPref] || !gotPref;
|
||||
BOOL jsEnabled = [self getBooleanPref:kGeckoPrefEnableJavascript withSuccess:&gotPref] && gotPref;
|
||||
BOOL pluginsEnabled = [self getBooleanPref:kGeckoPrefEnablePlugins withSuccess:&gotPref] || !gotPref;
|
||||
|
||||
return jsEnabled && pluginsEnabled;
|
||||
}
|
||||
|
@ -478,7 +473,7 @@ const int kAnnoyancePrefSome = 3;
|
|||
|
||||
// FlashBlock state can only change if it's already enabled
|
||||
// since changing dependencies won't have affect on disabled FlashBlock
|
||||
if (![self getBooleanPref:"camino.enable_flashblock" withSuccess:nil])
|
||||
if (![self getBooleanPref:kGeckoPrefBlockFlash withSuccess:NULL])
|
||||
return;
|
||||
|
||||
// FlashBlock preference is enabled. Checkbox is on if FlashBlock also allowed
|
||||
|
|
|
@ -95,12 +95,6 @@ extern const nsModuleComponentInfo* GetAppComponents(unsigned int* outNumCompone
|
|||
|
||||
static const char* ioServiceContractID = "@mozilla.org/network/io-service;1";
|
||||
|
||||
// Constants on how to behave when we are asked to open a URL from
|
||||
// another application. These are values of the "browser.reuse_window" pref.
|
||||
const int kOpenNewWindowOnAE = 0;
|
||||
const int kOpenNewTabOnAE = 1;
|
||||
const int kReuseWindowOnAE = 2;
|
||||
|
||||
// Key in the defaults system used to determine if we crashed last time.
|
||||
NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTerminatedNormally";
|
||||
|
||||
|
@ -292,7 +286,7 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
|
||||
// bring up the JS console service
|
||||
PreferenceManager* prefManager = [PreferenceManager sharedInstance];
|
||||
if ([prefManager getBooleanPref:"chimera.log_js_to_console" withSuccess:NULL])
|
||||
if ([prefManager getBooleanPref:kGeckoPrefLogJSToConsole withSuccess:NULL])
|
||||
[JSConsole sharedJSConsole];
|
||||
|
||||
[self setupRendezvous];
|
||||
|
@ -314,9 +308,9 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
BOOL shouldRestoreWindowState = NO;
|
||||
if ([[SessionManager sharedInstance] hasSavedState]) {
|
||||
if (previousSessionTerminatedNormally) {
|
||||
shouldRestoreWindowState = [prefManager getBooleanPref:"camino.remember_window_state" withSuccess:NULL];
|
||||
shouldRestoreWindowState = [prefManager getBooleanPref:kGeckoPrefSessionSaveEnabled withSuccess:NULL];
|
||||
}
|
||||
else if ([prefManager getBooleanPref:"browser.sessionstore.resume_from_crash" withSuccess:NULL]) {
|
||||
else if ([prefManager getBooleanPref:kGeckoPrefSessionSaveRestoreAfterCrash withSuccess:NULL]) {
|
||||
NSAlert* restoreAfterCrashAlert = [[[NSAlert alloc] init] autorelease];
|
||||
[restoreAfterCrashAlert addButtonWithTitle:NSLocalizedString(@"RestoreAfterCrashActionButton", nil)];
|
||||
[restoreAfterCrashAlert addButtonWithTitle:NSLocalizedString(@"RestoreAfterCrashCancelButton", nil)];
|
||||
|
@ -384,7 +378,7 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
if (!prefManager)
|
||||
return NSTerminateNow; // we didn't fully launch
|
||||
|
||||
if ([prefManager getBooleanPref:"camino.warn_when_closing" withSuccess:NULL]) {
|
||||
if ([prefManager getBooleanPref:kGeckoPrefWarnWhenClosingWindows withSuccess:NULL]) {
|
||||
NSString* quitAlertMsg = nil;
|
||||
NSString* quitAlertExpl = nil;
|
||||
|
||||
|
@ -422,7 +416,7 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
}
|
||||
|
||||
if (dontShowAgain)
|
||||
[prefManager setPref:"camino.warn_when_closing" toBoolean:NO];
|
||||
[prefManager setPref:kGeckoPrefWarnWhenClosingWindows toBoolean:NO];
|
||||
|
||||
if (!confirmed)
|
||||
return NSTerminateCancel;
|
||||
|
@ -453,7 +447,7 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
// If there's no pref manager then we didn't really start up, so we do nothing.
|
||||
PreferenceManager* prefManager = [PreferenceManager sharedInstanceDontCreate];
|
||||
if (prefManager) {
|
||||
if ([prefManager getBooleanPref:"camino.remember_window_state" withSuccess:NULL])
|
||||
if ([prefManager getBooleanPref:kGeckoPrefSessionSaveEnabled withSuccess:NULL])
|
||||
[[SessionManager sharedInstance] saveWindowState];
|
||||
else
|
||||
[[SessionManager sharedInstance] clearSavedState];
|
||||
|
@ -501,10 +495,11 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
return;
|
||||
// for non-nightly builds, show a special start page
|
||||
PreferenceManager* prefManager = [PreferenceManager sharedInstance];
|
||||
NSString* vendorSubString = [prefManager getStringPref:"general.useragent.vendorSub" withSuccess:NULL];
|
||||
NSString* vendorSubString = [prefManager getStringPref:kGeckoPrefUserAgentAppVersion withSuccess:NULL];
|
||||
if ([vendorSubString rangeOfString:@"pre"].location == NSNotFound) {
|
||||
// has the user seen this already?
|
||||
NSString* newVersionPageRev = [prefManager getStringPref:"browser.startup_page_override.version" withSuccess:NULL];
|
||||
NSString* newVersionPageRev = [prefManager getStringPref:kGeckoPrefNewVersionHomepageOverrideVersion
|
||||
withSuccess:NULL];
|
||||
if (![vendorSubString isEqualToString:newVersionPageRev]) {
|
||||
NSString* newVersionPage = NSLocalizedStringFromTable(@"NewVersionPage", @"WebsiteDefaults", nil);
|
||||
if ([newVersionPage length] && ![newVersionPage isEqualToString:@"NewVersionPage"]) {
|
||||
|
@ -512,14 +507,14 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
mStartURL = [newVersionPage retain];
|
||||
}
|
||||
// set the pref to say they've seen it
|
||||
[prefManager setPref:"browser.startup_page_override.version" toString:vendorSubString];
|
||||
[prefManager setPref:kGeckoPrefNewVersionHomepageOverrideVersion toString:vendorSubString];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setupRendezvous // aka "Bonjour"
|
||||
{
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:"camino.disable_bonjour" withSuccess:NULL]) {
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefDisableBonjour withSuccess:NULL]) {
|
||||
// remove rendezvous items
|
||||
int itemIndex;
|
||||
while ((itemIndex = [mBookmarksMenu indexOfItemWithTag:kRendezvousRelatedItemTag]) != -1)
|
||||
|
@ -537,12 +532,12 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
- (void)checkDefaultBrowser
|
||||
{
|
||||
BOOL prefSet;
|
||||
BOOL allowPrompt = [[PreferenceManager sharedInstance] getBooleanPref:"camino.check_default_browser"
|
||||
BOOL allowPrompt = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefCheckDefaultBrowserAtLaunch
|
||||
withSuccess:&prefSet];
|
||||
// Don't show the default browser alert on the very first launch (indicated by
|
||||
// the absence of any setting for camino.check_default_browser).
|
||||
if (!prefSet) {
|
||||
[[PreferenceManager sharedInstance] setPref:"camino.check_default_browser"
|
||||
[[PreferenceManager sharedInstance] setPref:kGeckoPrefCheckDefaultBrowserAtLaunch
|
||||
toBoolean:YES];
|
||||
return;
|
||||
}
|
||||
|
@ -571,7 +566,8 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
if (result == NSAlertDefaultReturn)
|
||||
[[NSWorkspace sharedWorkspace] setDefaultBrowserWithIdentifier:myIdentifier];
|
||||
|
||||
[[PreferenceManager sharedInstance] setPref:"camino.check_default_browser" toBoolean:!dontAskAgain];
|
||||
[[PreferenceManager sharedInstance] setPref:kGeckoPrefCheckDefaultBrowserAtLaunch
|
||||
toBoolean:!dontAskAgain];
|
||||
[controller release];
|
||||
}
|
||||
}
|
||||
|
@ -581,9 +577,9 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
{
|
||||
// See if we need to show the once-per-release warning about problem add-ons.
|
||||
PreferenceManager* prefManager = [PreferenceManager sharedInstance];
|
||||
NSString* vendorSubString = [prefManager getStringPref:"general.useragent.vendorSub" withSuccess:NULL];
|
||||
NSString* vendorSubString = [prefManager getStringPref:kGeckoPrefUserAgentAppVersion withSuccess:NULL];
|
||||
if ([vendorSubString rangeOfString:@"pre"].location == NSNotFound) {
|
||||
NSString* lastWarningVersion = [prefManager getStringPref:"camino.last_addon_check_version"
|
||||
NSString* lastWarningVersion = [prefManager getStringPref:kGeckoPrefLastAddOnWarningVersion
|
||||
withSuccess:NULL];
|
||||
if (![vendorSubString isEqualToString:lastWarningVersion]) {
|
||||
// Check by class for each of the add-ons that are known to have
|
||||
|
@ -618,7 +614,7 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
[addOnAlert runModal];
|
||||
}
|
||||
|
||||
[prefManager setPref:"camino.last_addon_check_version" toString:vendorSubString];
|
||||
[prefManager setPref:kGeckoPrefLastAddOnWarningVersion toString:vendorSubString];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -794,7 +790,8 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
// opening a new window or tab (observing the user's pref) if it's not already open
|
||||
- (void)showURL:(NSString*)aURL
|
||||
{
|
||||
int reuseWindow = [[PreferenceManager sharedInstance] getIntPref:"browser.reuse_window" withSuccess:NULL];
|
||||
int reuseWindow = [[PreferenceManager sharedInstance] getIntPref:kGeckoPrefExternalLoadBehavior
|
||||
withSuccess:NULL];
|
||||
|
||||
// Check to see if we already have the URL somewhere, and just show it if we do.
|
||||
NSEnumerator* windowEnumerator = [[NSApp orderedWindows] objectEnumerator];
|
||||
|
@ -818,9 +815,9 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
if (controller) {
|
||||
BOOL tabOrWindowIsAvailable = ([[controller browserWrapper] isEmpty] && ![[controller browserWrapper] isBusy]);
|
||||
|
||||
if (tabOrWindowIsAvailable || reuseWindow == kReuseWindowOnAE)
|
||||
if (tabOrWindowIsAvailable || reuseWindow == kExternalLoadReusesWindow)
|
||||
[controller loadURL:aURL];
|
||||
else if (reuseWindow == kOpenNewTabOnAE)
|
||||
else if (reuseWindow == kExternalLoadOpensNewTab)
|
||||
[controller openNewTabWithURL:aURL referrer:nil loadInBackground:NO allowPopups:NO setJumpback:NO];
|
||||
else
|
||||
controller = [controller openNewWindowWithURL:aURL referrer:nil loadInBackground:NO allowPopups:NO];
|
||||
|
@ -865,7 +862,8 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
BOOL openInNewTab = NO;
|
||||
BOOL newTabInBackground = NO;
|
||||
|
||||
BOOL loadNewTabsInBackgroundPref = [[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.loadInBackground" withSuccess:NULL];
|
||||
BOOL loadNewTabsInBackgroundPref = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefOpenTabsInBackground
|
||||
withSuccess:NULL];
|
||||
|
||||
// if the caller requests it, reverse the "open new tab/window in background" behavior.
|
||||
if (reverseBackgroundPref)
|
||||
|
@ -875,7 +873,7 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
|
||||
switch (behavior) {
|
||||
case eBookmarkOpenBehavior_NewPreferred:
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.opentabfor.middleclick" withSuccess:NULL]) {
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefOpenTabsForMiddleClick withSuccess:NULL]) {
|
||||
openInNewTab = YES;
|
||||
newTabInBackground = loadNewTabsInBackgroundPref;
|
||||
}
|
||||
|
@ -1186,8 +1184,8 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
[browserController newTab:aSender];
|
||||
else {
|
||||
// follow the pref about what to load in a new tab (even though we're making a new window)
|
||||
int newTabPage = [[PreferenceManager sharedInstance] getIntPref:"browser.tabs.startPage" withSuccess:NULL];
|
||||
BOOL loadHomepage = (newTabPage == 1);
|
||||
int newTabPage = [[PreferenceManager sharedInstance] getIntPref:kGeckoPrefNewTabStartPage withSuccess:NULL];
|
||||
BOOL loadHomepage = (newTabPage == kStartPageHome);
|
||||
|
||||
NSString* urlToLoad = @"about:blank";
|
||||
if (loadHomepage)
|
||||
|
@ -1296,7 +1294,7 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
BOOL doCloseWindows = YES;
|
||||
PreferenceManager* prefManager = [PreferenceManager sharedInstance];
|
||||
|
||||
if ([prefManager getBooleanPref:"camino.warn_when_closing" withSuccess:NULL]) {
|
||||
if ([prefManager getBooleanPref:kGeckoPrefWarnWhenClosingWindows withSuccess:NULL]) {
|
||||
NSString* closeAlertMsg = nil;
|
||||
NSString* closeAlertExpl = nil;
|
||||
|
||||
|
@ -1338,7 +1336,7 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
}
|
||||
|
||||
if (dontShowAgain)
|
||||
[prefManager setPref:"camino.warn_when_closing" toBoolean:NO];
|
||||
[prefManager setPref:kGeckoPrefWarnWhenClosingWindows toBoolean:NO];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1503,10 +1501,10 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
|
||||
- (IBAction)toggleAutoCharsetDetection:(id)aSender
|
||||
{
|
||||
NSString* detectorValue = [[PreferenceManager sharedInstance] getStringPref:"intl.charset.detector" withSuccess:NULL];
|
||||
BOOL universalChardetOn = [detectorValue isEqualToString:@"universal_charset_detector"];
|
||||
NSString* newValue = universalChardetOn ? @"" : @"universal_charset_detector";
|
||||
[[PreferenceManager sharedInstance] setPref:"intl.charset.detector" toString:newValue];
|
||||
NSString* detectorValue = [[PreferenceManager sharedInstance] getStringPref:kGeckoPrefCharsetDetector withSuccess:NULL];
|
||||
BOOL universalChardetOn = [detectorValue isEqualToString:kCharsetDetectorUniversal];
|
||||
NSString* newValue = universalChardetOn ? kCharsetDetectorNone : kCharsetDetectorUniversal;
|
||||
[[PreferenceManager sharedInstance] setPref:kGeckoPrefCharsetDetector toString:newValue];
|
||||
// and reload
|
||||
[self reload:nil];
|
||||
}
|
||||
|
@ -1759,7 +1757,7 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
|
||||
// key alternates
|
||||
if (action == @selector(openMenuBookmark:) && [aMenuItem isAlternate]) {
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.opentabfor.middleclick" withSuccess:NULL])
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefOpenTabsForMiddleClick withSuccess:NULL])
|
||||
[aMenuItem setTitle:NSLocalizedString(@"Open in New Tabs", nil)];
|
||||
else
|
||||
[aMenuItem setTitle:NSLocalizedString(@"Open in Tabs in New Window", nil)];
|
||||
|
@ -1859,8 +1857,8 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
|
|||
}
|
||||
|
||||
// update the state of the autodetect item
|
||||
NSString* detectorValue = [[PreferenceManager sharedInstance] getStringPref:"intl.charset.detector" withSuccess:NULL];
|
||||
BOOL universalChardetOn = [detectorValue isEqualToString:@"universal_charset_detector"];
|
||||
NSString* detectorValue = [[PreferenceManager sharedInstance] getStringPref:kGeckoPrefCharsetDetector withSuccess:NULL];
|
||||
BOOL universalChardetOn = [detectorValue isEqualToString:kCharsetDetectorUniversal];
|
||||
[[mTextEncodingsMenu itemWithTag:kEncodingMenuAutodetectItemTag] setState:(universalChardetOn ? NSOnState : NSOffState)];
|
||||
}
|
||||
|
||||
|
|
|
@ -232,7 +232,8 @@ static BookmarkManager* gBookmarkManager = nil;
|
|||
mBookmarkFaviconURLMap = [[NSMutableDictionary alloc] initWithCapacity:50];
|
||||
|
||||
mBookmarksLoaded = NO;
|
||||
mShowSiteIcons = [[PreferenceManager sharedInstance] getBooleanPref:"browser.chrome.favicons" withSuccess:NULL];
|
||||
mShowSiteIcons = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefEnableFavicons
|
||||
withSuccess:NULL];
|
||||
|
||||
mNotificationsSuppressedLock = [[NSRecursiveLock alloc] init];
|
||||
}
|
||||
|
@ -375,7 +376,7 @@ static BookmarkManager* gBookmarkManager = nil;
|
|||
// ten every three seconds to avoid locking up the UI with large bookmark lists.
|
||||
// XXX probably want a better way to do this. This sets up a timer (internally) for every
|
||||
// bookmark
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:"browser.chrome.favicons" withSuccess:NULL]) {
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefEnableFavicons withSuccess:NULL]) {
|
||||
float delay = 3.0; //default value
|
||||
int count = [allBookmarks count];
|
||||
for (int i = 0; i < count; ++i) {
|
||||
|
|
|
@ -236,7 +236,7 @@ const long kOpenInTabsTag = 0xBEEF;
|
|||
action:@selector(openMenuBookmark:)
|
||||
keyEquivalent:@""];
|
||||
NSMenuItem* altMenuItem;
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.opentabfor.middleclick" withSuccess:NULL])
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefOpenTabsForMiddleClick withSuccess:NULL])
|
||||
altMenuItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Open in New Tabs", nil)
|
||||
action:@selector(openMenuBookmark:)
|
||||
keyEquivalent:@""];
|
||||
|
|
|
@ -153,7 +153,8 @@ NSString* const kTabBarBackgroundDoubleClickedNotification = @"kTabBarBackground
|
|||
// make sure the tab view is removed
|
||||
[(BrowserTabViewItem *)tabViewItem willBeRemoved];
|
||||
if ([self selectedTabViewItem] == tabViewItem) {
|
||||
BOOL tabJumpbackPref = [[PreferenceManager sharedInstance] getBooleanPref:"camino.enable_tabjumpback" withSuccess:NULL];
|
||||
BOOL tabJumpbackPref = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefEnableTabJumpback
|
||||
withSuccess:NULL];
|
||||
|
||||
if (tabJumpbackPref && mJumpbackTab)
|
||||
[mJumpbackTab selectTab:self];
|
||||
|
|
|
@ -175,7 +175,6 @@ static NSString* const FormFillToolbarItemIdentifier = @"Form Fill Toolbar It
|
|||
static NSString* const HistoryToolbarItemIdentifier = @"History Toolbar Item";
|
||||
|
||||
int TabBarVisiblePrefChangedCallback(const char* pref, void* data);
|
||||
static const char* const gTabBarVisiblePref = "camino.tab_bar_always_visible";
|
||||
|
||||
const float kMinimumLocationBarWidth = 250.0;
|
||||
const float kMinimumURLAndSearchBarWidth = 128.0;
|
||||
|
@ -736,7 +735,7 @@ public:
|
|||
if (mWindowClosesQuietly)
|
||||
return YES;
|
||||
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:"camino.warn_when_closing" withSuccess:NULL]) {
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefWarnWhenClosingWindows withSuccess:NULL]) {
|
||||
unsigned int numberOfTabs = [mTabBrowser numberOfTabViewItems];
|
||||
if (numberOfTabs > 1) {
|
||||
NSString* closeMultipleTabWarning = NSLocalizedString(@"CloseWindowWithMultipleTabsExplFormat", @"");
|
||||
|
@ -760,8 +759,10 @@ public:
|
|||
@catch (id exception) {
|
||||
}
|
||||
|
||||
if (dontShowAgain)
|
||||
[[PreferenceManager sharedInstance] setPref:"camino.warn_when_closing" toBoolean:NO];
|
||||
if (dontShowAgain) {
|
||||
[[PreferenceManager sharedInstance] setPref:kGeckoPrefWarnWhenClosingWindows
|
||||
toBoolean:NO];
|
||||
}
|
||||
|
||||
if (result != NSAlertDefaultReturn)
|
||||
return NO;
|
||||
|
@ -794,7 +795,7 @@ public:
|
|||
|
||||
nsCOMPtr<nsIPref> pref(do_GetService(NS_PREF_CONTRACTID));
|
||||
if (pref)
|
||||
pref->UnregisterCallback(gTabBarVisiblePref, TabBarVisiblePrefChangedCallback, self);
|
||||
pref->UnregisterCallback(kGeckoPrefAlwaysShowTabBar, TabBarVisiblePrefChangedCallback, self);
|
||||
|
||||
// Tell the BrowserTabView the window is closed
|
||||
[mTabBrowser windowClosed];
|
||||
|
@ -965,11 +966,12 @@ public:
|
|||
!(mChromeMask & nsIWebBrowserChrome::CHROME_PERSONAL_TOOLBAR)))
|
||||
allowTabBar = NO;
|
||||
if (allowTabBar) {
|
||||
BOOL tabBarAlwaysVisible = [[PreferenceManager sharedInstance] getBooleanPref:gTabBarVisiblePref withSuccess:nil];
|
||||
BOOL tabBarAlwaysVisible = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefAlwaysShowTabBar
|
||||
withSuccess:NULL];
|
||||
[mTabBrowser setBarAlwaysVisible:tabBarAlwaysVisible];
|
||||
nsCOMPtr<nsIPref> pref(do_GetService(NS_PREF_CONTRACTID));
|
||||
if (pref)
|
||||
pref->RegisterCallback(gTabBarVisiblePref, TabBarVisiblePrefChangedCallback, self);
|
||||
pref->RegisterCallback(kGeckoPrefAlwaysShowTabBar, TabBarVisiblePrefChangedCallback, self);
|
||||
}
|
||||
|
||||
// remove the dummy tab view
|
||||
|
@ -1261,7 +1263,7 @@ public:
|
|||
BOOL loadInBackground = NO;
|
||||
if (destination == eDestinationNewTab) {
|
||||
loadInBackground =
|
||||
[[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.loadInBackground"
|
||||
[[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefOpenTabsInBackground
|
||||
withSuccess:NULL];
|
||||
}
|
||||
|
||||
|
@ -2096,7 +2098,7 @@ public:
|
|||
//
|
||||
-(BOOL)shouldWarnBeforeOpeningFeed
|
||||
{
|
||||
return [[PreferenceManager sharedInstance] getBooleanPref:"camino.warn_before_opening_feed" withSuccess:NULL];
|
||||
return [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefWarnBeforeOpeningFeeds withSuccess:NULL];
|
||||
}
|
||||
|
||||
// -openFeedInExternalApp
|
||||
|
@ -2478,7 +2480,7 @@ public:
|
|||
viewSource = [kViewSourceProtocolString stringByAppendingString:urlStr];
|
||||
}
|
||||
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:"camino.viewsource_in_tab" withSuccess:NULL]) {
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefViewSourceInTab withSuccess:NULL]) {
|
||||
if (desc)
|
||||
[self openNewTabWithDescriptor:desc displayType:nsIWebPageDescriptor::DISPLAY_AS_SOURCE loadInBackground:loadInBackground];
|
||||
else
|
||||
|
@ -2613,7 +2615,8 @@ public:
|
|||
BOOL loadInBackground = NO;
|
||||
// do search in a new window/tab if Command is held down
|
||||
if (modifiers & NSCommandKeyMask) {
|
||||
BOOL loadInTab = [[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.opentabfor.middleclick" withSuccess:NULL];
|
||||
BOOL loadInTab = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefOpenTabsForMiddleClick
|
||||
withSuccess:NULL];
|
||||
destination = loadInTab ? eDestinationNewTab : eDestinationNewWindow;
|
||||
loadInBackground = [BrowserWindowController shouldLoadInBackgroundForDestination:destination
|
||||
sender:nil];
|
||||
|
@ -3422,9 +3425,8 @@ public:
|
|||
BOOL loadHomepage = NO;
|
||||
if (contents == eNewTabHomepage)
|
||||
{
|
||||
// 0 = about:blank, 1 = home page, 2 = last page visited
|
||||
int newTabPage = [[PreferenceManager sharedInstance] getIntPref:"browser.tabs.startPage" withSuccess:NULL];
|
||||
loadHomepage = (newTabPage == 1);
|
||||
int newTabPage = [[PreferenceManager sharedInstance] getIntPref:kGeckoPrefNewTabStartPage withSuccess:NULL];
|
||||
loadHomepage = (newTabPage == kStartPageHome);
|
||||
}
|
||||
|
||||
[newTab setLabel: (loadHomepage ? NSLocalizedString(@"TabLoading", @"") : NSLocalizedString(@"UntitledPageTitle", @""))];
|
||||
|
@ -4210,7 +4212,8 @@ public:
|
|||
// Create command and command-shift alternates for applicable menu items
|
||||
if (needsAlternates) {
|
||||
NSArray* menuArray = [result itemArray];
|
||||
BOOL inNewTab = [[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.opentabfor.middleclick" withSuccess:NULL];
|
||||
BOOL inNewTab = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefOpenTabsForMiddleClick
|
||||
withSuccess:NULL];
|
||||
|
||||
for (int i = [menuArray count] - 1; i >= 0; i--) {
|
||||
NSMenuItem* menuItem = [menuArray objectAtIndex:i];
|
||||
|
@ -4677,7 +4680,8 @@ public:
|
|||
unsigned int modifiers = [aSender keyEquivalentModifierMask];
|
||||
|
||||
if (modifiers & NSCommandKeyMask) {
|
||||
BOOL loadInTab = [[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.opentabfor.middleclick" withSuccess:NULL];
|
||||
BOOL loadInTab = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefOpenTabsForMiddleClick
|
||||
withSuccess:NULL];
|
||||
BOOL loadInBG = [BrowserWindowController shouldLoadInBackgroundForDestination:(loadInTab ? eDestinationNewTab
|
||||
: eDestinationNewWindow)
|
||||
sender:nil];
|
||||
|
@ -5012,12 +5016,13 @@ public:
|
|||
- (BOOL)handleCommandReturn:(BOOL)aShiftIsDown
|
||||
{
|
||||
// determine whether to load in tab or window
|
||||
BOOL loadInTab = [[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.opentabfor.middleclick" withSuccess:NULL];
|
||||
BOOL loadInTab = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefOpenTabsForMiddleClick
|
||||
withSuccess:NULL];
|
||||
|
||||
// determine whether to load in background
|
||||
BOOL loadInBG = NO;
|
||||
if (loadInTab)
|
||||
loadInBG = [[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.loadInBackground" withSuccess:NULL];
|
||||
loadInBG = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefOpenTabsInBackground withSuccess:NULL];
|
||||
if (aShiftIsDown) // if shift is being held down, do the opposite of the pref
|
||||
loadInBG = !loadInBG;
|
||||
|
||||
|
@ -5191,8 +5196,9 @@ static Boolean movieControllerFilter(MovieController mc, short action, void *par
|
|||
//
|
||||
int TabBarVisiblePrefChangedCallback(const char* inPref, void* inBWC)
|
||||
{
|
||||
if (strcmp(inPref, gTabBarVisiblePref) == 0) {
|
||||
BOOL newValue = [[PreferenceManager sharedInstance] getBooleanPref:gTabBarVisiblePref withSuccess:nil];
|
||||
if (strcmp(inPref, kGeckoPrefAlwaysShowTabBar) == 0) {
|
||||
BOOL newValue = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefAlwaysShowTabBar
|
||||
withSuccess:NULL];
|
||||
BrowserWindowController* bwc = (BrowserWindowController*)inBWC;
|
||||
[[bwc tabBrowser] setBarAlwaysVisible:newValue];
|
||||
}
|
||||
|
|
|
@ -422,7 +422,7 @@ enum StatusPriority {
|
|||
[self setFrame:tabContentRect resizingBrowserViewIfHidden:YES];
|
||||
}
|
||||
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:"keyword.enabled" withSuccess:NULL])
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefEnableURLFixup withSuccess:NULL])
|
||||
flags |= NSLoadFlagsAllowThirdPartyFixup;
|
||||
|
||||
[self setPendingActive:focusContent];
|
||||
|
@ -643,7 +643,7 @@ enum StatusPriority {
|
|||
// immediately update the site icon (to the cached one, or the default)
|
||||
[self updateSiteIconImage:cachedImage withURI:cachedImageURI loadError:NO];
|
||||
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:"browser.chrome.favicons" withSuccess:NULL])
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefEnableFavicons withSuccess:NULL])
|
||||
{
|
||||
// note that this is the only time we hit the network for site icons.
|
||||
// note also that we may get a site icon from a link element later,
|
||||
|
@ -758,7 +758,8 @@ enum StatusPriority {
|
|||
- (void)updatePluginsEnabledState
|
||||
{
|
||||
BOOL gotPref;
|
||||
BOOL pluginsEnabled = [[PreferenceManager sharedInstance] getBooleanPref:"camino.enable_plugins" withSuccess:&gotPref];
|
||||
BOOL pluginsEnabled = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefEnablePlugins
|
||||
withSuccess:&gotPref];
|
||||
|
||||
// If we can't get the pref, ensure we leave plugins enabled.
|
||||
[mBrowserView setProperty:nsIWebBrowserSetup::SETUP_ALLOW_PLUGINS toValue:(gotPref ? pluginsEnabled : YES)];
|
||||
|
@ -814,7 +815,7 @@ enum StatusPriority {
|
|||
// Called when a "shortcut icon" link element is noticed
|
||||
- (void)onFoundShortcutIcon:(NSString*)inIconURI
|
||||
{
|
||||
BOOL useSiteIcons = [[PreferenceManager sharedInstance] getBooleanPref:"browser.chrome.favicons" withSuccess:NULL];
|
||||
BOOL useSiteIcons = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefEnableFavicons withSuccess:NULL];
|
||||
if (!useSiteIcons)
|
||||
return;
|
||||
|
||||
|
@ -876,10 +877,10 @@ enum StatusPriority {
|
|||
if ([mBrowserView isTextFieldFocused] || [mBrowserView isPluginFocused])
|
||||
return;
|
||||
|
||||
int backspaceAction = [[PreferenceManager sharedInstance] getIntPref:"browser.backspace_action"
|
||||
int backspaceAction = [[PreferenceManager sharedInstance] getIntPref:kGeckoPrefBackspaceAction
|
||||
withSuccess:NULL];
|
||||
|
||||
if (backspaceAction == 0) { // map to back/forward
|
||||
if (backspaceAction == kBackspaceActionBack) {
|
||||
if ([[NSApp currentEvent] modifierFlags] & NSShiftKeyMask)
|
||||
[mBrowserView goForward];
|
||||
else
|
||||
|
@ -997,8 +998,9 @@ enum StatusPriority {
|
|||
- (CHBrowserView*)reuseExistingBrowserWindow:(unsigned int)aMask
|
||||
{
|
||||
CHBrowserView* viewToUse = mBrowserView;
|
||||
int openNewWindow = [[PreferenceManager sharedInstance] getIntPref:"browser.link.open_newwindow" withSuccess:NULL];
|
||||
if (openNewWindow == nsIBrowserDOMWindow::OPEN_NEWTAB) {
|
||||
int openNewWindow = [[PreferenceManager sharedInstance] getIntPref:kGeckoPrefSingleWindowModeTargetBehavior
|
||||
withSuccess:NULL];
|
||||
if (openNewWindow == kSingleWindowModeUseNewTab) {
|
||||
// If browser.tabs.loadDivertedInBackground isn't set, we decide whether or
|
||||
// not to open the new tab in the background based on whether we're the fg
|
||||
// tab. If we are, we assume the user wants to see the new tab because it's
|
||||
|
@ -1006,7 +1008,7 @@ enum StatusPriority {
|
|||
// be bothered with a bg tab throwing things up in their face. We know
|
||||
// we're in the bg if our delegate is nil.
|
||||
BOOL loadInBackground;
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.loadDivertedInBackground" withSuccess:NULL])
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefSingleWindowModeTabsOpenInBackground withSuccess:NULL])
|
||||
loadInBackground = YES;
|
||||
else
|
||||
loadInBackground = (mDelegate == nil);
|
||||
|
@ -1024,16 +1026,18 @@ enum StatusPriority {
|
|||
//
|
||||
- (BOOL)shouldReuseExistingWindow
|
||||
{
|
||||
int openNewWindow = [[PreferenceManager sharedInstance] getIntPref:"browser.link.open_newwindow" withSuccess:NULL];
|
||||
BOOL shouldReuse = (openNewWindow == nsIBrowserDOMWindow::OPEN_CURRENTWINDOW ||
|
||||
openNewWindow == nsIBrowserDOMWindow::OPEN_NEWTAB);
|
||||
int openNewWindow = [[PreferenceManager sharedInstance] getIntPref:kGeckoPrefSingleWindowModeTargetBehavior
|
||||
withSuccess:NULL];
|
||||
BOOL shouldReuse = (openNewWindow == kSingleWindowModeUseCurrentTab ||
|
||||
openNewWindow == kSingleWindowModeUseNewTab);
|
||||
return shouldReuse;
|
||||
}
|
||||
|
||||
// Checks to see if we should allow window.open calls with specified size/position to open new windows (regardless of SWM)
|
||||
- (int)respectWindowOpenCallsWithSizeAndPosition
|
||||
{
|
||||
return ([[PreferenceManager sharedInstance] getIntPref:"browser.link.open_newwindow.restriction" withSuccess:NULL] == 2);
|
||||
return ([[PreferenceManager sharedInstance] getIntPref:kGeckoPrefSingleWindowModeRestriction
|
||||
withSuccess:NULL] == kSingleWindowModeApplyOnlyToUnfeatured);
|
||||
}
|
||||
|
||||
- (CHBrowserView*)browserView
|
||||
|
|
|
@ -114,7 +114,8 @@ ContentClickListener::MouseClick(nsIDOMEvent* aEvent)
|
|||
// The Command key is down or we got a middle-click.
|
||||
// Open the link in a new window or tab if it's an internally handled, non-Javascript link.
|
||||
if (![hrefScheme isEqualToString:@"javascript"] && GeckoUtils::isProtocolInternal([hrefScheme UTF8String])) {
|
||||
BOOL useTab = [[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.opentabfor.middleclick" withSuccess:NULL];
|
||||
BOOL useTab = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefOpenTabsForMiddleClick
|
||||
withSuccess:NULL];
|
||||
BOOL loadInBackground = [BrowserWindowController shouldLoadInBackgroundForDestination:(useTab ? eDestinationNewTab
|
||||
: eDestinationNewWindow)
|
||||
sender:nil];
|
||||
|
|
|
@ -245,7 +245,7 @@ static FeedServiceController* sInstance = nil;
|
|||
//
|
||||
-(void)shouldWarnWhenOpeningFeed:(BOOL)inState
|
||||
{
|
||||
[[PreferenceManager sharedInstance] setPref:"camino.warn_before_opening_feed" toBoolean:inState];
|
||||
[[PreferenceManager sharedInstance] setPref:kGeckoPrefWarnBeforeOpeningFeeds toBoolean:inState];
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -338,7 +338,7 @@ static const unsigned int kMaxTitleLength = 50;
|
|||
BrowserWindowController* bwc = [(MainController *)[NSApp delegate] mainWindowBrowserController];
|
||||
if (bwc) {
|
||||
if ([sender keyEquivalentModifierMask] & NSCommandKeyMask) {
|
||||
BOOL openInTab = [[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.opentabfor.middleclick"
|
||||
BOOL openInTab = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefOpenTabsForMiddleClick
|
||||
withSuccess:NULL];
|
||||
BOOL backgroundLoad = [BrowserWindowController shouldLoadInBackgroundForDestination:(openInTab ? eDestinationNewTab
|
||||
: eDestinationNewWindow)
|
||||
|
|
|
@ -505,7 +505,7 @@ static id gSharedProgressController = nil;
|
|||
// looking around to see what happened. We always want the download window to come to the
|
||||
// front on a new download (unless they set a user_pref);
|
||||
BOOL gotPref = NO;
|
||||
BOOL bringToFront = [[PreferenceManager sharedInstance] getBooleanPref:"browser.download.progressDnldDialog.bringToFront" withSuccess:&gotPref];
|
||||
BOOL bringToFront = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefFocusDownloadManagerOnDownload withSuccess:&gotPref];
|
||||
if (gotPref && bringToFront)
|
||||
[[self window] makeKeyAndOrderFront:self];
|
||||
|
||||
|
@ -547,7 +547,8 @@ static id gSharedProgressController = nil;
|
|||
if ([self numDownloadsInProgress] == 0)
|
||||
{
|
||||
BOOL gotPref;
|
||||
BOOL keepDownloadsOpen = [[PreferenceManager sharedInstance] getBooleanPref:"browser.download.progressDnldDialog.keepAlive" withSuccess:&gotPref];
|
||||
BOOL keepDownloadsOpen = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefLeaveDownloadManagerOpen
|
||||
withSuccess:&gotPref];
|
||||
if (gotPref && !keepDownloadsOpen)
|
||||
{
|
||||
// don't call -performClose: on the window, because we don't want Cocoa to look
|
||||
|
@ -815,10 +816,10 @@ static id gSharedProgressController = nil;
|
|||
// Return true if the pref is set to remove downloads when the application quits
|
||||
-(BOOL)shouldRemoveDownloadsOnQuit
|
||||
{
|
||||
int downloadRemovalPolicy = [[PreferenceManager sharedInstance] getIntPref:"browser.download.downloadRemoveAction"
|
||||
int downloadRemovalPolicy = [[PreferenceManager sharedInstance] getIntPref:kGeckoPrefDownloadCleanupPolicy
|
||||
withSuccess:NULL];
|
||||
|
||||
return downloadRemovalPolicy == kRemoveDownloadsOnQuitPrefValue ? YES : NO;
|
||||
return downloadRemovalPolicy == kRemoveDownloadsOnQuit ? YES : NO;
|
||||
}
|
||||
|
||||
// Get the downloads.plist path
|
||||
|
|
|
@ -62,12 +62,6 @@ typedef enum {
|
|||
DownloadSelectByExtending
|
||||
} DownloadSelectionBehavior;
|
||||
|
||||
// Define these auto remove download pref values here
|
||||
// becase both ProgressViewController and ProgressDlgController
|
||||
// need to use them. Note that the manual removal pref value is 0.
|
||||
const int kRemoveDownloadsOnQuitPrefValue = 1;
|
||||
const int kRemoveUponSuccessfulDownloadPrefValue = 2;
|
||||
|
||||
//
|
||||
// interface ProgressViewController
|
||||
//
|
||||
|
|
|
@ -389,7 +389,7 @@ enum {
|
|||
-(void)launchFileIfAppropriate
|
||||
{
|
||||
if (!mIsFileSave && !mUserCancelled && !mDownloadFailed) {
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:"browser.download.autoDispatch" withSuccess:NULL]) {
|
||||
if ([[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefAutoOpenDownloads withSuccess:NULL]) {
|
||||
[[NSWorkspace sharedWorkspace] openFile:mDestPath];
|
||||
}
|
||||
}
|
||||
|
@ -399,9 +399,9 @@ enum {
|
|||
{
|
||||
if (![self hasSucceeded])
|
||||
return NO;
|
||||
int downloadRemoveActionValue = [[PreferenceManager sharedInstance] getIntPref:"browser.download.downloadRemoveAction"
|
||||
int downloadRemoveActionValue = [[PreferenceManager sharedInstance] getIntPref:kGeckoPrefDownloadCleanupPolicy
|
||||
withSuccess:NULL];
|
||||
return (downloadRemoveActionValue == kRemoveUponSuccessfulDownloadPrefValue);
|
||||
return (downloadRemoveActionValue == kRemoveDownloadsOnSuccess);
|
||||
}
|
||||
|
||||
// this handles lots of things - all of the status updates
|
||||
|
|
|
@ -541,7 +541,8 @@ NS_IMETHODIMP FormFillListener::HandleEvent(nsIDOMEvent* aEvent)
|
|||
if (NS_FAILED(inputElement->GetReadOnly(&isReadOnly)) || isReadOnly)
|
||||
return;
|
||||
|
||||
PRBool autoCompleteOverride = [[PreferenceManager sharedInstance] getBooleanPref:"wallet.crypto.autocompleteoverride" withSuccess:NULL];
|
||||
PRBool autoCompleteOverride = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefIgnoreAutocompleteOff
|
||||
withSuccess:NULL];
|
||||
|
||||
if (!autoCompleteOverride) {
|
||||
nsAutoString autocomplete;
|
||||
|
|
|
@ -1477,7 +1477,8 @@ nsresult FindUsernamePasswordFields(nsIDOMHTMLFormElement* inFormElement,
|
|||
return NS_ERROR_FAILURE;
|
||||
*outUsername = *outPassword = nsnull;
|
||||
|
||||
PRBool autoCompleteOverride = [[PreferenceManager sharedInstance] getBooleanPref:"wallet.crypto.autocompleteoverride" withSuccess:NULL];
|
||||
PRBool autoCompleteOverride = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefIgnoreAutocompleteOff
|
||||
withSuccess:NULL];
|
||||
|
||||
// pages can specify that they don't want autofill by setting a
|
||||
// "autocomplete=off" attribute on the form.
|
||||
|
|
|
@ -411,7 +411,8 @@ static int HistoryItemSort(id firstItem, id secondItem, void* context)
|
|||
|
||||
// Read the history cutoff so that we don't create too many folders
|
||||
BOOL gotPref = NO;
|
||||
int expireDays = [[PreferenceManager sharedInstance] getIntPref:"browser.history_expire_days" withSuccess:&gotPref];
|
||||
int expireDays = [[PreferenceManager sharedInstance] getIntPref:kGeckoPrefHistoryLifetimeDays
|
||||
withSuccess:&gotPref];
|
||||
if (!gotPref)
|
||||
expireDays = kDefaultExpireDays;
|
||||
else if (expireDays == 0) {
|
||||
|
@ -701,7 +702,8 @@ NS_IMPL_ISUPPORTS1(nsHistoryObserver, nsIHistoryObserver);
|
|||
name:SiteIconLoadNotificationName
|
||||
object:nil];
|
||||
|
||||
mShowSiteIcons = [[PreferenceManager sharedInstance] getBooleanPref:"browser.chrome.favicons" withSuccess:NULL];
|
||||
mShowSiteIcons = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefEnableFavicons
|
||||
withSuccess:NULL];
|
||||
}
|
||||
|
||||
return self;
|
||||
|
|
|
@ -203,7 +203,8 @@ static NSString* const kExpandedHistoryStatesDefaultsKey = @"history_expand_stat
|
|||
return;
|
||||
}
|
||||
|
||||
BOOL openInTabs = [[PreferenceManager sharedInstance] getBooleanPref:"browser.tabs.opentabfor.middleclick" withSuccess:NULL];
|
||||
BOOL openInTabs = [[PreferenceManager sharedInstance] getBooleanPref:kGeckoPrefOpenTabsForMiddleClick
|
||||
withSuccess:NULL];
|
||||
BOOL loadInBackground = [BrowserWindowController shouldLoadInBackgroundForDestination:(openInTabs ? eDestinationNewTab
|
||||
: eDestinationNewWindow)
|
||||
sender:sender];
|
||||
|
|
|
@ -0,0 +1,306 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Camino code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Stuart Morgan
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Stuart Morgan <stuart.morgan@alumni.case.edu>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#pragma mark Tab Behavior
|
||||
|
||||
// Controls whether the tab bar is show even when there is only one tab.
|
||||
extern const char* const kGeckoPrefAlwaysShowTabBar; // bool
|
||||
|
||||
// Controls the load behavior of URLs loaded from external applications.
|
||||
extern const char* const kGeckoPrefExternalLoadBehavior; // int
|
||||
// Possible values:
|
||||
extern const int kExternalLoadOpensNewWindow;
|
||||
extern const int kExternalLoadOpensNewTab;
|
||||
extern const int kExternalLoadReusesWindow;
|
||||
|
||||
// Controls whether middle/command-clicking opens a tab instead of a window
|
||||
extern const char* const kGeckoPrefOpenTabsForMiddleClick; // bool
|
||||
|
||||
// Controls whether user-opened tabs open in the background (i.e., don't focus)
|
||||
extern const char* const kGeckoPrefOpenTabsInBackground; // bool
|
||||
|
||||
// Controls where links that would open new windows open.
|
||||
extern const char* const kGeckoPrefSingleWindowModeTargetBehavior; // int
|
||||
// Posible values:
|
||||
extern const int kSingleWindowModeUseDefault;
|
||||
extern const int kSingleWindowModeUseCurrentTab;
|
||||
extern const int kSingleWindowModeUseNewTab;
|
||||
extern const int kSingleWindowModeUseNewWindow;
|
||||
|
||||
// Controls when kGeckoPrefSingleWindowModeTargetBehavior actually applies
|
||||
extern const char* const kGeckoPrefSingleWindowModeRestriction; // int
|
||||
// Possible values:
|
||||
extern const int kSingleWindowModeApplyAlways;
|
||||
extern const int kSingleWindowModeApplyNever;
|
||||
extern const int kSingleWindowModeApplyOnlyToUnfeatured;
|
||||
|
||||
// Controls whether tabs diverted by SWM open in the background
|
||||
extern const char* const kGeckoPrefSingleWindowModeTabsOpenInBackground; // bool
|
||||
|
||||
// Controls whether tab jumpback is enabled
|
||||
extern const char* const kGeckoPrefEnableTabJumpback; // bool
|
||||
|
||||
// Controls wheter source is opened in a tab rather than a window
|
||||
extern const char* const kGeckoPrefViewSourceInTab; // bool
|
||||
|
||||
#pragma mark Warnings
|
||||
|
||||
// Controls whether there is a warning before closing multi-tab windows
|
||||
extern const char* const kGeckoPrefWarnWhenClosingWindows; // bool
|
||||
|
||||
// Controls whether there is a warning before opening a feed: link
|
||||
extern const char* const kGeckoPrefWarnBeforeOpeningFeeds; // bool
|
||||
|
||||
// The last version for which the user was warned about possible add-on problems
|
||||
extern const char* const kGeckoPrefLastAddOnWarningVersion; // string
|
||||
|
||||
#pragma mark Content Control
|
||||
|
||||
// Controls whether Javascript is enabled
|
||||
extern const char* const kGeckoPrefEnableJavascript; // bool
|
||||
|
||||
// Controls whether Java is enabled
|
||||
extern const char* const kGeckoPrefEnableJava; // bool
|
||||
|
||||
// Controls whether Plugins are enabled
|
||||
extern const char* const kGeckoPrefEnablePlugins; // bool
|
||||
|
||||
// Controls whether the popup blocker is enabled
|
||||
extern const char* const kGeckoPrefBlockPopups; // bool
|
||||
|
||||
// Controls whether ads are blocked
|
||||
extern const char* const kGeckoPrefBlockAds; // bool
|
||||
|
||||
// Controls whether Flashblock is enabled
|
||||
extern const char* const kGeckoPrefBlockFlash; // bool
|
||||
|
||||
// Controls how animated images are allowed to animate
|
||||
extern const char* const kGeckoPrefImageAnimationBehavior; // string
|
||||
// Possible values:
|
||||
extern NSString* const kImageAnimationNone;
|
||||
extern NSString* const kImageAnimationOnce;
|
||||
extern NSString* const kImageAnimationLoop;
|
||||
|
||||
// Controls whether JS window resizing is disabled
|
||||
extern const char* const kGeckoPrefPreventDOMWindowResize; // bool
|
||||
|
||||
// Controls whether JS window status bar updating is disabled
|
||||
extern const char* const kGeckoPrefPreventDOMStatusChange; // bool
|
||||
|
||||
// Controls whether JS window reordering is disabled
|
||||
extern const char* const kGeckoPrefPreventDOMWindowFocus; // bool
|
||||
|
||||
#pragma mark Home Page
|
||||
|
||||
// The homepage URL
|
||||
extern const char* const kGeckoPrefHomepageURL; // string
|
||||
|
||||
// Controls what page is loaded in new windows
|
||||
extern const char* const kGeckoPrefNewWindowStartPage; // int
|
||||
// Controls what page is loaded in new tabs
|
||||
extern const char* const kGeckoPrefNewTabStartPage; // int
|
||||
// Possible values:
|
||||
extern const int kStartPageBlank;
|
||||
extern const int kStartPageHome;
|
||||
// other Mozilla/Firefox values are not implement in Camino
|
||||
|
||||
// Records the last version where the homepage override has been applied
|
||||
extern const char* const kGeckoPrefNewVersionHomepageOverrideVersion; // string
|
||||
|
||||
#pragma mark Security
|
||||
|
||||
// Controls how personal certificates are chosen
|
||||
extern const char* const kGeckoPrefDefaultCertificateBehavior; // string
|
||||
// Possible values:
|
||||
extern NSString* const kPersonalCertificateSelectAutomatically;
|
||||
extern NSString* const kPersonalCertificateAlwaysAsk;
|
||||
|
||||
// Controls whether autocomplete="off" is ignored for password managment
|
||||
extern const char* const kGeckoPrefIgnoreAutocompleteOff; // bool
|
||||
|
||||
#pragma mark Miscellaneous UI Controls
|
||||
|
||||
// Controls whether JS/CSS errors are logged to the console
|
||||
extern const char* const kGeckoPrefLogJSToConsole; // bool
|
||||
|
||||
// Controls whether favicons are used in browser chrome
|
||||
extern const char* const kGeckoPrefEnableFavicons; // bool
|
||||
|
||||
// Controls whether URL fixup (e.g., search on DNS failure) is enabled
|
||||
extern const char* const kGeckoPrefEnableURLFixup; // bool
|
||||
|
||||
// Controls whether Bonjour has been disabled
|
||||
extern const char* const kGeckoPrefDisableBonjour; // bool
|
||||
|
||||
// Controls whether the default browser is checked at each launch
|
||||
extern const char* const kGeckoPrefCheckDefaultBrowserAtLaunch; // bool
|
||||
|
||||
#pragma mark Keyboard Shortcuts
|
||||
|
||||
// Controls the behavior of the backspace/delete key
|
||||
extern const char* const kGeckoPrefBackspaceAction; // int
|
||||
// Possible values:
|
||||
extern const int kBackspaceActionBack;
|
||||
extern const int kBackspaceActionNone;
|
||||
// paging is not implemented in Camino
|
||||
|
||||
// Controls the behavior of tabbing through page elements.
|
||||
extern const char* const kGeckoPrefTabFocusBehavior; // int
|
||||
// Possible values (note that these are OR-able, not mutually exclusive):
|
||||
extern const int kTabFocusesTextFields;
|
||||
extern const int kTabFocusesForms;
|
||||
extern const int kTabFocusesLinks;
|
||||
|
||||
#pragma mark Auto-Update
|
||||
|
||||
// The base URL for software update checks
|
||||
extern const char* const kGeckoPrefUpdateURL; // string
|
||||
|
||||
// A user-override for kGeckoPrefUpdateURL
|
||||
extern const char* const kGeckoPrefUpdateURLOverride; // string
|
||||
|
||||
#pragma mark i18n
|
||||
|
||||
// The ranked languages to send in the Accept-Languages header
|
||||
extern const char* const kGeckoPrefAcceptLanguages; // string
|
||||
|
||||
// A user override for the automatically-determined kGeckoPrefAcceptLanguages
|
||||
extern const char* const kGeckoPrefAcceptLanguagesOverride; // string
|
||||
|
||||
// The automatic character set detector to use for unspecified pages
|
||||
extern const char* const kGeckoPrefCharsetDetector; // string
|
||||
// Possible values:
|
||||
extern NSString* const kCharsetDetectorNone;
|
||||
extern NSString* const kCharsetDetectorUniversal;
|
||||
|
||||
#pragma mark Session Saving
|
||||
|
||||
// Controls whether session restore is enabled for normal relaunches
|
||||
extern const char* const kGeckoPrefSessionSaveEnabled; // bool
|
||||
|
||||
// Controls whether session restore is enabled across crashes (for auto-tests)
|
||||
extern const char* const kGeckoPrefSessionSaveRestoreAfterCrash; // bool
|
||||
|
||||
#pragma mark History
|
||||
|
||||
// Controls how many days history is kept for
|
||||
extern const char* const kGeckoPrefHistoryLifetimeDays; // int
|
||||
|
||||
#pragma mark Cookies
|
||||
|
||||
// Controls how cookies are handled by default
|
||||
extern const char* const kGeckoPrefCookieDefaultAcceptPolicy; // int
|
||||
// Possible values:
|
||||
extern const int kCookieAcceptAll;
|
||||
extern const int kCookieAcceptFromOriginatingServer;
|
||||
extern const int kCookieAcceptNone;
|
||||
|
||||
// Controls how long cookies last. Also whether or not the user is prompted
|
||||
// for each cookie, because mashing orthogonal concepts together is fun!
|
||||
extern const char* const kGeckoPrefCookieLifetimePolicy; // int
|
||||
// Possible values:
|
||||
extern const int kCookieLifetimeNormal;
|
||||
extern const int kCookieLifetimeAsk;
|
||||
extern const int kCookieLifetimeSession;
|
||||
|
||||
#pragma mark Proxies
|
||||
|
||||
// Controls whether the proxy settings are taken from the OS settings
|
||||
extern const char* const kGeckoPrefProxyUsesSystemSettings; // bool
|
||||
|
||||
// The url of a PAC file to use for proxy settings
|
||||
extern const char* const kGeckoPrefProxyAutoconfigURL; // string
|
||||
|
||||
// A list of sites for which the proxy should not be applied
|
||||
extern const char* const kGeckoPrefProxyBypassList; // string
|
||||
|
||||
#pragma mark Downloads
|
||||
|
||||
// Controls whether downloads should be auto-launched
|
||||
extern const char* const kGeckoPrefAutoOpenDownloads; // bool
|
||||
|
||||
extern const char* const kGeckoPrefDownloadCleanupPolicy; // int
|
||||
// Possible values:
|
||||
extern const int kRemoveDownloadsManually;
|
||||
extern const int kRemoveDownloadsOnQuit;
|
||||
extern const int kRemoveDownloadsOnSuccess;
|
||||
|
||||
// Controls whether the download manager is focused when a download is started
|
||||
extern const char* const kGeckoPrefFocusDownloadManagerOnDownload; // bool
|
||||
|
||||
// Controls whether the download manager stays open after downloads complete
|
||||
extern const char* const kGeckoPrefLeaveDownloadManagerOpen; // bool
|
||||
|
||||
#pragma mark Page Appearance
|
||||
|
||||
// Controls whether links are underlined by default
|
||||
extern const char* const kGeckoPrefUnderlineLinks; // bool
|
||||
|
||||
// Controls whether page-specified fonts should be used
|
||||
extern const char* const kGeckoPrefUsePageFonts; // bool
|
||||
|
||||
// Controls whether page-specified colors should be used
|
||||
extern const char* const kGeckoPrefUsePageColors; // bool
|
||||
|
||||
// The default page background color
|
||||
extern const char* const kGeckoPrefPageBackgroundColor; // color
|
||||
|
||||
// The default page foreground color
|
||||
extern const char* const kGeckoPrefPageForegroundColor; // color
|
||||
|
||||
// The default link color
|
||||
extern const char* const kGeckoPrefLinkColor; // color
|
||||
|
||||
// The default visited link color
|
||||
extern const char* const kGeckoPrefVisitedLinkColor; // color
|
||||
|
||||
#pragma mark User Agent
|
||||
|
||||
// The application version to use in the user agent
|
||||
extern const char* const kGeckoPrefUserAgentAppVersion; // string
|
||||
|
||||
// The locale to use in the user agent
|
||||
extern const char* const kGeckoPrefUserAgentLocale; // string
|
||||
|
||||
// A user override for the automatically-determined kGeckoPrefUserAgentLocale
|
||||
extern const char* const kGeckoPrefUserAgentLocaleOverride; // string
|
||||
|
||||
// An extra suffix for the user agent identifying the multilingual build
|
||||
extern const char* const kGeckoPrefUserAgentMultiLangAddition; // string
|
|
@ -0,0 +1,212 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Camino code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Stuart Morgan
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Stuart Morgan <stuart.morgan@alumni.case.edu>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#import "GeckoPrefConstants.h";
|
||||
|
||||
#import "nsIBrowserDOMWindow.h"
|
||||
|
||||
#pragma mark Tab Behavior
|
||||
|
||||
const char* const kGeckoPrefAlwaysShowTabBar = "camino.tab_bar_always_visible";
|
||||
const char* const kGeckoPrefExternalLoadBehavior = "browser.reuse_window";
|
||||
const char* const kGeckoPrefOpenTabsForMiddleClick = "browser.tabs.opentabfor.middleclick";
|
||||
const char* const kGeckoPrefOpenTabsInBackground = "browser.tabs.loadInBackground";
|
||||
const char* const kGeckoPrefSingleWindowModeTargetBehavior = "browser.link.open_newwindow";
|
||||
const char* const kGeckoPrefSingleWindowModeRestriction = "browser.link.open_newwindow.restriction";
|
||||
const char* const kGeckoPrefSingleWindowModeTabsOpenInBackground = "browser.tabs.loadDivertedInBackground";
|
||||
const char* const kGeckoPrefEnableTabJumpback = "camino.enable_tabjumpback";
|
||||
const char* const kGeckoPrefViewSourceInTab = "camino.viewsource_in_tab";
|
||||
|
||||
#pragma mark Warnings
|
||||
|
||||
const char* const kGeckoPrefWarnWhenClosingWindows = "camino.warn_when_closing";
|
||||
const char* const kGeckoPrefWarnBeforeOpeningFeeds = "camino.warn_before_opening_feed";
|
||||
const char* const kGeckoPrefLastAddOnWarningVersion = "camino.last_addon_check_version";
|
||||
|
||||
#pragma mark Content Control
|
||||
|
||||
const char* const kGeckoPrefEnableJavascript = "javascript.enabled";
|
||||
const char* const kGeckoPrefEnableJava = "security.enable_java";
|
||||
const char* const kGeckoPrefEnablePlugins = "camino.enable_plugins";
|
||||
const char* const kGeckoPrefBlockPopups = "dom.disable_open_during_load";
|
||||
const char* const kGeckoPrefBlockAds = "camino.enable_ad_blocking";
|
||||
const char* const kGeckoPrefBlockFlash = "camino.enable_flashblock";
|
||||
const char* const kGeckoPrefImageAnimationBehavior = "image.animation_mode";
|
||||
const char* const kGeckoPrefPreventDOMWindowResize = "dom.disable_window_move_resize";
|
||||
const char* const kGeckoPrefPreventDOMStatusChange = "dom.disable_window_status_change";
|
||||
const char* const kGeckoPrefPreventDOMWindowFocus = "dom.disable_window_flip";
|
||||
|
||||
#pragma mark Home Page
|
||||
|
||||
const char* const kGeckoPrefHomepageURL = "browser.startup.homepage";
|
||||
const char* const kGeckoPrefNewWindowStartPage = "browser.startup.page";
|
||||
const char* const kGeckoPrefNewTabStartPage = "browser.tabs.startPage";
|
||||
const char* const kGeckoPrefNewVersionHomepageOverrideVersion = "browser.startup_page_override.version";
|
||||
|
||||
#pragma mark Security
|
||||
|
||||
const char* const kGeckoPrefDefaultCertificateBehavior = "security.default_personal_cert";
|
||||
const char* const kGeckoPrefIgnoreAutocompleteOff = "wallet.crypto.autocompleteoverride";
|
||||
|
||||
#pragma mark Miscellaneous UI Controls
|
||||
|
||||
const char* const kGeckoPrefLogJSToConsole = "chimera.log_js_to_console";
|
||||
const char* const kGeckoPrefEnableFavicons = "browser.chrome.favicons";
|
||||
const char* const kGeckoPrefEnableURLFixup = "keyword.enabled";
|
||||
const char* const kGeckoPrefDisableBonjour = "camino.disable_bonjour";
|
||||
const char* const kGeckoPrefCheckDefaultBrowserAtLaunch = "camino.check_default_browser";
|
||||
|
||||
#pragma mark Keyboard Shortcuts
|
||||
|
||||
const char* const kGeckoPrefBackspaceAction = "browser.backspace_action";
|
||||
const char* const kGeckoPrefTabFocusBehavior = "accessibility.tabfocus";
|
||||
|
||||
#pragma mark Auto-Update
|
||||
|
||||
const char* const kGeckoPrefUpdateURL = "app.update.url";
|
||||
const char* const kGeckoPrefUpdateURLOverride = "app.update.url.override";
|
||||
|
||||
#pragma mark i18n
|
||||
|
||||
const char* const kGeckoPrefAcceptLanguages = "intl.accept_languages";
|
||||
const char* const kGeckoPrefAcceptLanguagesOverride = "camino.accept_languages";
|
||||
const char* const kGeckoPrefCharsetDetector = "intl.charset.detector";
|
||||
|
||||
#pragma mark Session Saving
|
||||
|
||||
const char* const kGeckoPrefSessionSaveEnabled = "camino.remember_window_state";
|
||||
const char* const kGeckoPrefSessionSaveRestoreAfterCrash = "browser.sessionstore.resume_from_crash";
|
||||
|
||||
#pragma mark History
|
||||
|
||||
const char* const kGeckoPrefHistoryLifetimeDays = "browser.history_expire_days";
|
||||
|
||||
#pragma mark Cookies
|
||||
|
||||
const char* const kGeckoPrefCookieDefaultAcceptPolicy = "network.cookie.cookieBehavior";
|
||||
const char* const kGeckoPrefCookieLifetimePolicy = "network.cookie.lifetimePolicy";
|
||||
|
||||
#pragma mark Proxies
|
||||
|
||||
const char* const kGeckoPrefProxyUsesSystemSettings = "camino.use_system_proxy_settings";
|
||||
const char* const kGeckoPrefProxyAutoconfigURL = "network.proxy.autoconfig_url";
|
||||
const char* const kGeckoPrefProxyBypassList = "network.proxy.no_proxies_on";
|
||||
|
||||
#pragma mark Downloads
|
||||
|
||||
const char* const kGeckoPrefAutoOpenDownloads = "browser.download.autoDispatch";
|
||||
const char* const kGeckoPrefDownloadCleanupPolicy = "browser.download.downloadRemoveAction";
|
||||
const char* const kGeckoPrefFocusDownloadManagerOnDownload = "browser.download.progressDnldDialog.bringToFront";
|
||||
const char* const kGeckoPrefLeaveDownloadManagerOpen = "browser.download.progressDnldDialog.keepAlive";
|
||||
|
||||
#pragma mark Page Appearance
|
||||
|
||||
const char* const kGeckoPrefUnderlineLinks = "browser.underline_anchors";
|
||||
const char* const kGeckoPrefUsePageFonts = "browser.display.use_document_fonts";
|
||||
const char* const kGeckoPrefUsePageColors = "browser.display.use_document_colors";
|
||||
const char* const kGeckoPrefPageBackgroundColor = "browser.display.background_color";
|
||||
const char* const kGeckoPrefPageForegroundColor = "browser.display.foreground_color";
|
||||
const char* const kGeckoPrefLinkColor = "browser.anchor_color";
|
||||
const char* const kGeckoPrefVisitedLinkColor = "browser.visited_color";
|
||||
|
||||
#pragma mark User Agent
|
||||
|
||||
const char* const kGeckoPrefUserAgentAppVersion = "general.useragent.vendorSub";
|
||||
const char* const kGeckoPrefUserAgentLocale = "general.useragent.locale";
|
||||
const char* const kGeckoPrefUserAgentLocaleOverride = "camino.useragent.locale";
|
||||
const char* const kGeckoPrefUserAgentMultiLangAddition = "general.useragent.extra.multilang";
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Values
|
||||
|
||||
// kGeckoPrefExternalLoadBehavior values
|
||||
const int kExternalLoadOpensNewWindow = 0;
|
||||
const int kExternalLoadOpensNewTab = 1;
|
||||
const int kExternalLoadReusesWindow = 2;
|
||||
|
||||
// kGeckoPrefSingleWindowModeTargetBehavior values
|
||||
const int kSingleWindowModeUseDefault = nsIBrowserDOMWindow::OPEN_DEFAULTWINDOW;
|
||||
const int kSingleWindowModeUseCurrentTab = nsIBrowserDOMWindow::OPEN_CURRENTWINDOW;
|
||||
const int kSingleWindowModeUseNewTab = nsIBrowserDOMWindow::OPEN_NEWTAB;
|
||||
const int kSingleWindowModeUseNewWindow = nsIBrowserDOMWindow::OPEN_NEWWINDOW;
|
||||
|
||||
// kGeckoPrefSingleWindowModeRestriction values
|
||||
const int kSingleWindowModeApplyAlways = 0;
|
||||
const int kSingleWindowModeApplyNever = 1;
|
||||
const int kSingleWindowModeApplyOnlyToUnfeatured = 2;
|
||||
|
||||
// kGeckoPrefImageAnimationBehavior values
|
||||
NSString* const kImageAnimationNone = @"none";
|
||||
NSString* const kImageAnimationOnce = @"once";
|
||||
NSString* const kImageAnimationLoop = @"normal";
|
||||
|
||||
// kGeckoPrefNewWindowStartPage and kGeckoPrefNewTabStartPage values
|
||||
const int kStartPageBlank = 0;
|
||||
const int kStartPageHome = 1;
|
||||
|
||||
// kGeckoPrefDefaultCertificateBehavior values
|
||||
NSString* const kPersonalCertificateSelectAutomatically = @"Select Automatically";
|
||||
NSString* const kPersonalCertificateAlwaysAsk = @"Ask Every Time";
|
||||
|
||||
// kGeckoPrefBackspaceAction values
|
||||
const int kBackspaceActionBack = 0;
|
||||
const int kBackspaceActionNone = 2;
|
||||
|
||||
// kGeckoPrefTabFocusBehavior values
|
||||
const int kTabFocusesTextFields = (1 << 0);
|
||||
const int kTabFocusesForms = (1 << 1);
|
||||
const int kTabFocusesLinks = (1 << 2);
|
||||
|
||||
// kGeckoPrefCharsetDetector values
|
||||
NSString* const kCharsetDetectorNone = @"";
|
||||
NSString* const kCharsetDetectorUniversal = @"universal_charset_detector";
|
||||
|
||||
// kGeckoPrefCookieDefaultAcceptPolicy values
|
||||
const int kCookieAcceptAll = 0;
|
||||
const int kCookieAcceptFromOriginatingServer = 1;
|
||||
const int kCookieAcceptNone = 2;
|
||||
|
||||
// kGeckoPrefCookieLifetimePolicy values
|
||||
const int kCookieLifetimeNormal = 0;
|
||||
const int kCookieLifetimeAsk = 1;
|
||||
const int kCookieLifetimeSession = 2;
|
||||
|
||||
// kGeckoPrefDownloadCleanupPolicy values
|
||||
const int kRemoveDownloadsManually = 0;
|
||||
const int kRemoveDownloadsOnQuit = 1;
|
||||
const int kRemoveDownloadsOnSuccess = 2;
|
|
@ -38,6 +38,9 @@
|
|||
#import <AppKit/AppKit.h>
|
||||
#import <Carbon/Carbon.h>
|
||||
|
||||
// Pull in the constants so all the consumers don't have to do so explicitly.
|
||||
#import "GeckoPrefConstants.h"
|
||||
|
||||
class nsProfileDirServiceProvider;
|
||||
class nsIPref;
|
||||
|
||||
|
|
|
@ -669,16 +669,16 @@ static BOOL gMadePrefManager;
|
|||
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
// Get the base auto-update manifest URL
|
||||
NSString* baseURL = [self getStringPref:"app.update.url.override"
|
||||
NSString* baseURL = [self getStringPref:kGeckoPrefUpdateURLOverride
|
||||
withSuccess:NULL];
|
||||
if (![baseURL length])
|
||||
baseURL = [self getStringPref:"app.update.url" withSuccess:NULL];
|
||||
baseURL = [self getStringPref:kGeckoPrefUpdateURL withSuccess:NULL];
|
||||
|
||||
// An empty manifestURL will tell Sparkle not to check for updates.
|
||||
NSString* manifestURL = @"";
|
||||
if ([baseURL length]) {
|
||||
// Append the parameters we might be interested in.
|
||||
NSString* intlUAString = [self getStringPref:"general.useragent.extra.multilang"
|
||||
NSString* intlUAString = [self getStringPref:kGeckoPrefUserAgentMultiLangAddition
|
||||
withSuccess:NULL];
|
||||
NSArray* languages = [[NSBundle mainBundle] localizations];
|
||||
NSString* currentLanguage = [[NSBundle preferredLocalizationsFromArray:languages] firstObject];
|
||||
|
@ -776,10 +776,10 @@ static BOOL gMadePrefManager;
|
|||
// 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";
|
||||
static const char* kCookieBehaviorPref = kGeckoPrefCookieDefaultAcceptPolicy;
|
||||
mPrefs->GetIntPref(kCookieBehaviorPref, &acceptCookies);
|
||||
if (acceptCookies == 3) { // p3p, assume all cookies on
|
||||
acceptCookies = 0;
|
||||
acceptCookies = kCookieAcceptAll;
|
||||
mPrefs->SetIntPref(kCookieBehaviorPref, acceptCookies);
|
||||
}
|
||||
|
||||
|
@ -789,23 +789,23 @@ static BOOL gMadePrefManager;
|
|||
[self setLocalePref];
|
||||
|
||||
// load up the default stylesheet (is this the best place to do this?)
|
||||
if ([self getBooleanPref:"camino.enable_ad_blocking" withSuccess:NULL])
|
||||
if ([self getBooleanPref:kGeckoPrefBlockAds withSuccess:NULL])
|
||||
[self refreshAdBlockingStyleSheet:YES];
|
||||
|
||||
// Load flashblock if enabled. Test dependencies to avoid conflicts
|
||||
BOOL flashBlockAllowed = [self isFlashBlockAllowed];
|
||||
if (flashBlockAllowed && [self getBooleanPref:"camino.enable_flashblock" withSuccess:NULL])
|
||||
if (flashBlockAllowed && [self getBooleanPref:kGeckoPrefBlockFlash withSuccess:NULL])
|
||||
[self refreshFlashBlockStyleSheet:YES];
|
||||
|
||||
// Make sure the homepage has been set up.
|
||||
nsCOMPtr<nsIPrefBranch> prefBranch = do_QueryInterface(mPrefs);
|
||||
if (prefBranch) {
|
||||
PRInt32 homepagePrefExists;
|
||||
if (NS_FAILED(prefBranch->PrefHasUserValue("browser.startup.homepage", &homepagePrefExists)) || !homepagePrefExists) {
|
||||
if (NS_FAILED(prefBranch->PrefHasUserValue(kGeckoPrefHomepageURL, &homepagePrefExists)) || !homepagePrefExists) {
|
||||
NSString* defaultHomepage = NSLocalizedStringFromTable(@"HomePageDefault", @"WebsiteDefaults", nil);
|
||||
// Check that we actually got a sane value back before storing it.
|
||||
if (![defaultHomepage isEqualToString:@"HomePageDefault"])
|
||||
[self setPref:"browser.startup.homepage" toString:defaultHomepage];
|
||||
[self setPref:kGeckoPrefHomepageURL toString:defaultHomepage];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -815,11 +815,11 @@ static BOOL gMadePrefManager;
|
|||
// Determine if the user specified their own language override. If so
|
||||
// use it. If not work out the languages from the system preferences.
|
||||
BOOL userProvidedLangOverride = NO;
|
||||
NSString* userLanguageOverride = [self getStringPref:"camino.accept_languages"
|
||||
NSString* userLanguageOverride = [self getStringPref:kGeckoPrefAcceptLanguagesOverride
|
||||
withSuccess:&userProvidedLangOverride];
|
||||
|
||||
if (userProvidedLangOverride && [userLanguageOverride length] > 0)
|
||||
[self setPref:"intl.accept_languages" toString:userLanguageOverride];
|
||||
[self setPref:kGeckoPrefAcceptLanguages toString:userLanguageOverride];
|
||||
else {
|
||||
NSUserDefaults* defs = [NSUserDefaults standardUserDefaults];
|
||||
NSArray* languages = [defs objectForKey:@"AppleLanguages"];
|
||||
|
@ -868,12 +868,12 @@ static BOOL gMadePrefManager;
|
|||
[acceptableLanguages removeObjectsInRange:dropRange];
|
||||
}
|
||||
NSString* acceptLangHeader = [acceptableLanguages componentsJoinedByString:@","];
|
||||
[self setPref:"intl.accept_languages" toString:acceptLangHeader];
|
||||
[self setPref:kGeckoPrefAcceptLanguages toString:acceptLangHeader];
|
||||
}
|
||||
else {
|
||||
// Fall back to the "en-us, en" default from all-camino.js - clear
|
||||
// any existing user pref
|
||||
[self clearPref:"intl.accept_languages"];
|
||||
[self clearPref:kGeckoPrefAcceptLanguages];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -881,8 +881,8 @@ static BOOL gMadePrefManager;
|
|||
- (void)setLocalePref
|
||||
{
|
||||
// Use the user-selected pref for the user agent locale if it exists
|
||||
NSString* uaLocale = [self getStringPref:"camino.useragent.locale"
|
||||
withSuccess:nil];
|
||||
NSString* uaLocale = [self getStringPref:kGeckoPrefUserAgentLocaleOverride
|
||||
withSuccess:NULL];
|
||||
|
||||
if (![uaLocale length]) {
|
||||
// Find the active localization nib's name and make sure it's in
|
||||
|
@ -901,13 +901,13 @@ static BOOL gMadePrefManager;
|
|||
}
|
||||
|
||||
if (uaLocale && [uaLocale length]) {
|
||||
[self setPref:"general.useragent.locale" toString:uaLocale];
|
||||
[self setPref:kGeckoPrefUserAgentLocale toString:uaLocale];
|
||||
}
|
||||
else {
|
||||
NSLog(@"Unable to determine user interface locale\n");
|
||||
// Fall back to the "en-US" default from all.js. Clear any existing
|
||||
// user pref.
|
||||
[self clearPref:"general.useragent.locale"];
|
||||
[self clearPref:kGeckoPrefUserAgentLocale];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -988,9 +988,9 @@ typedef enum EProxyConfig {
|
|||
|
||||
- (void)readSystemProxySettings
|
||||
{
|
||||
// if the user has set "camino.use_system_proxy_settings" to false, they want
|
||||
// if the user has set kGeckoPrefProxyUsesSystemSettings to false, they want
|
||||
// to specify their own proxies (or a PAC), so don't read the OS proxy settings
|
||||
if (![self getBooleanPref:"camino.use_system_proxy_settings" withSuccess:NULL])
|
||||
if (![self getBooleanPref:kGeckoPrefProxyUsesSystemSettings withSuccess:NULL])
|
||||
return;
|
||||
|
||||
PRInt32 curProxyType, newProxyType;
|
||||
|
@ -1007,7 +1007,7 @@ typedef enum EProxyConfig {
|
|||
mPrefs->ClearUserPref("network.proxy.gopher_port");
|
||||
mPrefs->ClearUserPref("network.proxy.socks");
|
||||
mPrefs->ClearUserPref("network.proxy.socks_port");
|
||||
mPrefs->ClearUserPref("network.proxy.no_proxies_on");
|
||||
mPrefs->ClearUserPref(kGeckoPrefProxyBypassList);
|
||||
|
||||
// get proxies from SystemConfiguration
|
||||
NSDictionary* proxyConfigDict = (NSDictionary*)SCDynamicStoreCopyProxies(NULL);
|
||||
|
@ -1017,7 +1017,7 @@ typedef enum EProxyConfig {
|
|||
NSString* proxyURLString = (NSString*)[proxyConfigDict objectForKey:(NSString*)kSCPropNetProxiesProxyAutoConfigURLString];
|
||||
if ([proxyAutoConfig intValue] != 0 && [proxyURLString length] > 0) {
|
||||
NSLog(@"Using Proxy Auto-Config (PAC) file %@", proxyURLString);
|
||||
[self setPref:"network.proxy.autoconfig_url" toString:proxyURLString];
|
||||
[self setPref:kGeckoPrefProxyAutoconfigURL toString:proxyURLString];
|
||||
newProxyType = eProxyConfig_PAC;
|
||||
}
|
||||
else {
|
||||
|
@ -1055,7 +1055,7 @@ typedef enum EProxyConfig {
|
|||
if (exceptions) {
|
||||
NSString* sitesList = [exceptions componentsJoinedByString:@", "];
|
||||
if ([sitesList length] > 0)
|
||||
[self setPref:"network.proxy.no_proxies_on" toString:sitesList];
|
||||
[self setPref:kGeckoPrefProxyBypassList toString:sitesList];
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -1075,7 +1075,7 @@ typedef enum EProxyConfig {
|
|||
|
||||
- (void)adBlockingPrefChanged:(NSNotification*)inNotification
|
||||
{
|
||||
BOOL adBlockingEnabled = [self getBooleanPref:"camino.enable_ad_blocking" withSuccess:nil];
|
||||
BOOL adBlockingEnabled = [self getBooleanPref:kGeckoPrefBlockAds withSuccess:NULL];
|
||||
[self refreshAdBlockingStyleSheet:adBlockingEnabled];
|
||||
}
|
||||
|
||||
|
@ -1083,7 +1083,7 @@ typedef enum EProxyConfig {
|
|||
{
|
||||
BOOL allowed = [self isFlashBlockAllowed];
|
||||
|
||||
BOOL flashBlockEnabled = allowed && [self getBooleanPref:"camino.enable_flashblock" withSuccess:nil];
|
||||
BOOL flashBlockEnabled = allowed && [self getBooleanPref:kGeckoPrefBlockFlash withSuccess:NULL];
|
||||
[self refreshFlashBlockStyleSheet:flashBlockEnabled];
|
||||
}
|
||||
|
||||
|
@ -1242,19 +1242,15 @@ typedef enum EProxyConfig {
|
|||
if (!mPrefs)
|
||||
return @"about:blank";
|
||||
|
||||
PRInt32 mode = 1;
|
||||
|
||||
// In some cases, we need to check browser.startup.page to see if
|
||||
// we want to use the homepage or if the user wants a blank window.
|
||||
// mode 0 is blank page, mode 1 is home page. 2 is "last page visited"
|
||||
// but we don't care about that. Default to 1 unless |checkStartupPagePref|
|
||||
// is true.
|
||||
nsresult rv = NS_OK;
|
||||
// If |checkStartupPagePref|, always return the homepage, otherwise check the
|
||||
// user's pref for new windows.
|
||||
BOOL success = NO;
|
||||
int mode = kStartPageHome;
|
||||
if (checkStartupPagePref)
|
||||
rv = mPrefs->GetIntPref("browser.startup.page", &mode);
|
||||
mode = [self getIntPref:kGeckoPrefNewWindowStartPage withSuccess:&success];
|
||||
|
||||
if (NS_FAILED(rv) || mode == 1) {
|
||||
NSString* homepagePref = [self getStringPref:"browser.startup.homepage" withSuccess:NULL];
|
||||
if (!success || mode == kStartPageHome) {
|
||||
NSString* homepagePref = [self getStringPref:kGeckoPrefHomepageURL withSuccess:NULL];
|
||||
if (!homepagePref)
|
||||
homepagePref = NSLocalizedStringFromTable(@"HomePageDefault", @"WebsiteDefaults", nil);
|
||||
|
||||
|
@ -1391,8 +1387,8 @@ typedef enum EProxyConfig {
|
|||
-(BOOL) isFlashBlockAllowed
|
||||
{
|
||||
BOOL gotPref = NO;
|
||||
BOOL jsEnabled = [self getBooleanPref:"javascript.enabled" withSuccess:&gotPref] && gotPref;
|
||||
BOOL pluginsEnabled = [self getBooleanPref:"camino.enable_plugins" withSuccess:&gotPref] || !gotPref;
|
||||
BOOL jsEnabled = [self getBooleanPref:kGeckoPrefEnableJavascript withSuccess:&gotPref] && gotPref;
|
||||
BOOL pluginsEnabled = [self getBooleanPref:kGeckoPrefEnablePlugins withSuccess:&gotPref] || !gotPref;
|
||||
|
||||
return jsEnabled && pluginsEnabled;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче