Bug 659536 part.2 Replace nsContentUtils::GetIntPref() with Preferences::GetInt() or Preferences::GetUint() r=roc

This commit is contained in:
Masayuki Nakano 2011-05-25 15:32:00 +09:00
parent 2c22152882
commit 49814a538d
29 changed files with 116 additions and 111 deletions

View File

@ -551,7 +551,6 @@ public:
nsIAtom **aTagName, PRInt32 *aNameSpaceID); nsIAtom **aTagName, PRInt32 *aNameSpaceID);
static nsAdoptingCString GetCharPref(const char *aPref); static nsAdoptingCString GetCharPref(const char *aPref);
static PRInt32 GetIntPref(const char *aPref, PRInt32 aDefault = 0);
static nsAdoptingString GetLocalizedStringPref(const char *aPref); static nsAdoptingString GetLocalizedStringPref(const char *aPref);
static nsAdoptingString GetStringPref(const char *aPref); static nsAdoptingString GetStringPref(const char *aPref);
static void RegisterPrefCallback(const char *aPref, static void RegisterPrefCallback(const char *aPref,

View File

@ -2611,20 +2611,6 @@ nsContentUtils::GetCharPref(const char *aPref)
return result; return result;
} }
// static
PRInt32
nsContentUtils::GetIntPref(const char *aPref, PRInt32 aDefault)
{
PRInt32 result;
if (!sPrefBranch ||
NS_FAILED(sPrefBranch->GetIntPref(aPref, &result))) {
result = aDefault;
}
return result;
}
// static // static
nsAdoptingString nsAdoptingString
nsContentUtils::GetLocalizedStringPref(const char *aPref) nsContentUtils::GetLocalizedStringPref(const char *aPref)
@ -2746,7 +2732,7 @@ IntVarChanged(const char *aPref, void *aClosure)
{ {
PrefCacheData* cache = static_cast<PrefCacheData*>(aClosure); PrefCacheData* cache = static_cast<PrefCacheData*>(aClosure);
*((PRInt32*)cache->cacheLocation) = *((PRInt32*)cache->cacheLocation) =
nsContentUtils::GetIntPref(aPref, cache->defaultValueInt); Preferences::GetInt(aPref, cache->defaultValueInt);
return 0; return 0;
} }
@ -2756,7 +2742,7 @@ nsContentUtils::AddIntPrefVarCache(const char *aPref,
PRInt32* aCache, PRInt32* aCache,
PRInt32 aDefault) PRInt32 aDefault)
{ {
*aCache = GetIntPref(aPref, aDefault); *aCache = Preferences::GetInt(aPref, aDefault);
PrefCacheData* data = new PrefCacheData; PrefCacheData* data = new PrefCacheData;
data->cacheLocation = aCache; data->cacheLocation = aCache;
data->defaultValueInt = aDefault; data->defaultValueInt = aDefault;

View File

@ -299,8 +299,8 @@ nsEventSource::Init(nsIPrincipal* aPrincipal,
mOrigin = origin; mOrigin = origin;
mReconnectionTime = mReconnectionTime =
nsContentUtils::GetIntPref("dom.server-events.default-reconnection-time", Preferences::GetInt("dom.server-events.default-reconnection-time",
DEFAULT_RECONNECTION_TIME_VALUE); DEFAULT_RECONNECTION_TIME_VALUE);
nsCOMPtr<nsICharsetConverterManager> convManager = nsCOMPtr<nsICharsetConverterManager> convManager =
do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv); do_GetService(NS_CHARSETCONVERTERMANAGER_CONTRACTID, &rv);

View File

@ -211,7 +211,7 @@ nsPlainTextSerializer::Init(PRUint32 aFlags, PRUint32 aWrapColumn,
mStructs = Preferences::GetBool(PREF_STRUCTS, mStructs); mStructs = Preferences::GetBool(PREF_STRUCTS, mStructs);
mHeaderStrategy = mHeaderStrategy =
nsContentUtils::GetIntPref(PREF_HEADER_STRATEGY, mHeaderStrategy); Preferences::GetInt(PREF_HEADER_STRATEGY, mHeaderStrategy);
// The quotesPreformatted pref is a temporary measure. See bug 69638. // The quotesPreformatted pref is a temporary measure. See bug 69638.
mQuotesPreformatted = mQuotesPreformatted =

View File

@ -328,7 +328,7 @@ GetDocumentFromWindow(nsIDOMWindow *aWindow)
static PRInt32 static PRInt32
GetAccessModifierMaskFromPref(PRInt32 aItemType) GetAccessModifierMaskFromPref(PRInt32 aItemType)
{ {
PRInt32 accessKey = nsContentUtils::GetIntPref("ui.key.generalAccessKey", -1); PRInt32 accessKey = Preferences::GetInt("ui.key.generalAccessKey", -1);
switch (accessKey) { switch (accessKey) {
case -1: break; // use the individual prefs case -1: break; // use the individual prefs
case nsIDOMKeyEvent::DOM_VK_SHIFT: return NS_MODIFIER_SHIFT; case nsIDOMKeyEvent::DOM_VK_SHIFT: return NS_MODIFIER_SHIFT;
@ -340,9 +340,9 @@ GetAccessModifierMaskFromPref(PRInt32 aItemType)
switch (aItemType) { switch (aItemType) {
case nsIDocShellTreeItem::typeChrome: case nsIDocShellTreeItem::typeChrome:
return nsContentUtils::GetIntPref("ui.key.chromeAccess", 0); return Preferences::GetInt("ui.key.chromeAccess", 0);
case nsIDocShellTreeItem::typeContent: case nsIDocShellTreeItem::typeContent:
return nsContentUtils::GetIntPref("ui.key.contentAccess", 0); return Preferences::GetInt("ui.key.contentAccess", 0);
default: default:
return 0; return 0;
} }
@ -654,15 +654,13 @@ nsMouseWheelTransaction::GetScreenPoint(nsGUIEvent* aEvent)
PRUint32 PRUint32
nsMouseWheelTransaction::GetTimeoutTime() nsMouseWheelTransaction::GetTimeoutTime()
{ {
return (PRUint32) return Preferences::GetUint("mousewheel.transaction.timeout", 1500);
nsContentUtils::GetIntPref("mousewheel.transaction.timeout", 1500);
} }
PRUint32 PRUint32
nsMouseWheelTransaction::GetIgnoreMoveDelayTime() nsMouseWheelTransaction::GetIgnoreMoveDelayTime()
{ {
return (PRUint32) return Preferences::GetUint("mousewheel.transaction.ignoremovedelay", 100);
nsContentUtils::GetIntPref("mousewheel.transaction.ignoremovedelay", 100);
} }
PRBool PRBool
@ -711,13 +709,13 @@ nsMouseWheelTransaction::ComputeAcceleratedWheelDelta(PRInt32 aDelta,
PRInt32 PRInt32
nsMouseWheelTransaction::GetAccelerationStart() nsMouseWheelTransaction::GetAccelerationStart()
{ {
return nsContentUtils::GetIntPref("mousewheel.acceleration.start", -1); return Preferences::GetInt("mousewheel.acceleration.start", -1);
} }
PRInt32 PRInt32
nsMouseWheelTransaction::GetAccelerationFactor() nsMouseWheelTransaction::GetAccelerationFactor()
{ {
return nsContentUtils::GetIntPref("mousewheel.acceleration.factor", -1); return Preferences::GetInt("mousewheel.acceleration.factor", -1);
} }
PRInt32 PRInt32
@ -1723,7 +1721,7 @@ nsEventStateManager::CreateClickHoldTimer(nsPresContext* inPresContext,
mClickHoldTimer = do_CreateInstance("@mozilla.org/timer;1"); mClickHoldTimer = do_CreateInstance("@mozilla.org/timer;1");
if (mClickHoldTimer) { if (mClickHoldTimer) {
PRInt32 clickHoldDelay = PRInt32 clickHoldDelay =
nsContentUtils::GetIntPref("ui.click_hold_context_menus.delay", 500); Preferences::GetInt("ui.click_hold_context_menus.delay", 500);
mClickHoldTimer->InitWithFuncCallback(sClickHoldCallback, this, mClickHoldTimer->InitWithFuncCallback(sClickHoldCallback, this,
clickHoldDelay, clickHoldDelay,
nsITimer::TYPE_ONE_SHOT); nsITimer::TYPE_ONE_SHOT);
@ -2404,8 +2402,8 @@ nsEventStateManager::ChangeTextSize(PRInt32 change)
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
float textzoom; float textzoom;
float zoomMin = ((float)nsContentUtils::GetIntPref("zoom.minPercent", 50)) / 100; float zoomMin = ((float)Preferences::GetInt("zoom.minPercent", 50)) / 100;
float zoomMax = ((float)nsContentUtils::GetIntPref("zoom.maxPercent", 300)) / 100; float zoomMax = ((float)Preferences::GetInt("zoom.maxPercent", 300)) / 100;
mv->GetTextZoom(&textzoom); mv->GetTextZoom(&textzoom);
textzoom += ((float)change) / 10; textzoom += ((float)change) / 10;
if (textzoom < zoomMin) if (textzoom < zoomMin)
@ -2425,8 +2423,8 @@ nsEventStateManager::ChangeFullZoom(PRInt32 change)
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
float fullzoom; float fullzoom;
float zoomMin = ((float)nsContentUtils::GetIntPref("zoom.minPercent", 50)) / 100; float zoomMin = ((float)Preferences::GetInt("zoom.minPercent", 50)) / 100;
float zoomMax = ((float)nsContentUtils::GetIntPref("zoom.maxPercent", 300)) / 100; float zoomMax = ((float)Preferences::GetInt("zoom.maxPercent", 300)) / 100;
mv->GetFullZoom(&fullzoom); mv->GetFullZoom(&fullzoom);
fullzoom += ((float)change) / 10; fullzoom += ((float)change) / 10;
if (fullzoom < zoomMin) if (fullzoom < zoomMin)
@ -2612,7 +2610,7 @@ nsEventStateManager::GetWheelActionFor(nsMouseScrollEvent* aMouseEvent)
nsCAutoString prefName; nsCAutoString prefName;
GetBasePrefKeyForMouseWheel(aMouseEvent, prefName); GetBasePrefKeyForMouseWheel(aMouseEvent, prefName);
prefName.Append(".action"); prefName.Append(".action");
return nsContentUtils::GetIntPref(prefName.get()); return Preferences::GetInt(prefName.get());
} }
PRInt32 PRInt32
@ -2623,7 +2621,7 @@ nsEventStateManager::GetScrollLinesFor(nsMouseScrollEvent* aMouseEvent)
nsCAutoString prefName; nsCAutoString prefName;
GetBasePrefKeyForMouseWheel(aMouseEvent, prefName); GetBasePrefKeyForMouseWheel(aMouseEvent, prefName);
prefName.Append(".numlines"); prefName.Append(".numlines");
return nsContentUtils::GetIntPref(prefName.get()); return Preferences::GetInt(prefName.get());
} }
PRBool PRBool

View File

@ -899,8 +899,7 @@ nsGenericHTMLElement::GetSpellcheck(PRBool* aSpellcheck)
// NOTE: Do not reflect a pref value of 0 back to the DOM getter. // NOTE: Do not reflect a pref value of 0 back to the DOM getter.
// The web page should not know if the user has disabled spellchecking. // The web page should not know if the user has disabled spellchecking.
// We'll catch this in the editor itself. // We'll catch this in the editor itself.
PRInt32 spellcheckLevel = PRInt32 spellcheckLevel = Preferences::GetInt("layout.spellcheckDefault", 1);
nsContentUtils::GetIntPref("layout.spellcheckDefault", 1);
if (spellcheckLevel == 2) { // "Spellcheck multi- and single-line" if (spellcheckLevel == 2) { // "Spellcheck multi- and single-line"
*aSpellcheck = PR_TRUE; // Spellchecked by default *aSpellcheck = PR_TRUE; // Spellchecked by default
} }

View File

@ -857,10 +857,12 @@ void nsHTMLMediaElement::UpdatePreloadAction()
// Find the appropriate preload action by looking at the attribute. // Find the appropriate preload action by looking at the attribute.
const nsAttrValue* val = mAttrsAndChildren.GetAttr(nsGkAtoms::preload, const nsAttrValue* val = mAttrsAndChildren.GetAttr(nsGkAtoms::preload,
kNameSpaceID_None); kNameSpaceID_None);
PRUint32 preloadDefault = nsContentUtils::GetIntPref("media.preload.default", PRUint32 preloadDefault =
nsHTMLMediaElement::PRELOAD_ATTR_METADATA); Preferences::GetInt("media.preload.default",
PRUint32 preloadAuto = nsContentUtils::GetIntPref("media.preload.auto", nsHTMLMediaElement::PRELOAD_ATTR_METADATA);
nsHTMLMediaElement::PRELOAD_ENOUGH); PRUint32 preloadAuto =
Preferences::GetInt("media.preload.auto",
nsHTMLMediaElement::PRELOAD_ENOUGH);
if (!val) { if (!val) {
// Attribute is not set. Use the preload action specified by the // Attribute is not set. Use the preload action specified by the
// media.preload.default pref, or just preload metadata if not present. // media.preload.default pref, or just preload metadata if not present.

View File

@ -63,6 +63,7 @@
#include "nsNodeUtils.h" #include "nsNodeUtils.h"
#include "nsIContent.h" #include "nsIContent.h"
#include "mozilla/dom/Element.h" #include "mozilla/dom/Element.h"
#include "mozilla/Preferences.h"
#include "nsGenericHTMLElement.h" #include "nsGenericHTMLElement.h"
@ -122,6 +123,7 @@
#include "nsContentCreatorFunctions.h" #include "nsContentCreatorFunctions.h"
#include "mozAutoDocUpdate.h" #include "mozAutoDocUpdate.h"
using namespace mozilla;
using namespace mozilla::dom; using namespace mozilla::dom;
#ifdef NS_DEBUG #ifdef NS_DEBUG
@ -1597,7 +1599,7 @@ HTMLContentSink::Init(nsIDocument* aDoc,
// Changed from 8192 to greatly improve page loading performance on // Changed from 8192 to greatly improve page loading performance on
// large pages. See bugzilla bug 77540. // large pages. See bugzilla bug 77540.
mMaxTextRun = nsContentUtils::GetIntPref("content.maxtextrun", 8191); mMaxTextRun = Preferences::GetInt("content.maxtextrun", 8191);
nsCOMPtr<nsINodeInfo> nodeInfo; nsCOMPtr<nsINodeInfo> nodeInfo;
nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::html, nsnull, nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::html, nsnull,

View File

@ -40,7 +40,6 @@
#include "mozilla/XPCOM.h" #include "mozilla/XPCOM.h"
#include "nsMediaCache.h" #include "nsMediaCache.h"
#include "nsContentUtils.h"
#include "nsDirectoryServiceUtils.h" #include "nsDirectoryServiceUtils.h"
#include "nsDirectoryServiceDefs.h" #include "nsDirectoryServiceDefs.h"
#include "nsNetUtil.h" #include "nsNetUtil.h"
@ -50,6 +49,7 @@
#include "nsMathUtils.h" #include "nsMathUtils.h"
#include "prlog.h" #include "prlog.h"
#include "nsIPrivateBrowsingService.h" #include "nsIPrivateBrowsingService.h"
#include "mozilla/Preferences.h"
using namespace mozilla; using namespace mozilla;
@ -739,7 +739,7 @@ static PRInt32 GetMaxBlocks()
// We look up the cache size every time. This means dynamic changes // We look up the cache size every time. This means dynamic changes
// to the pref are applied. // to the pref are applied.
// Cache size is in KB // Cache size is in KB
PRInt32 cacheSize = nsContentUtils::GetIntPref("media.cache_size", 500*1024); PRInt32 cacheSize = Preferences::GetInt("media.cache_size", 500*1024);
PRInt64 maxBlocks = static_cast<PRInt64>(cacheSize)*1024/nsMediaCache::BLOCK_SIZE; PRInt64 maxBlocks = static_cast<PRInt64>(cacheSize)*1024/nsMediaCache::BLOCK_SIZE;
maxBlocks = PR_MAX(maxBlocks, 1); maxBlocks = PR_MAX(maxBlocks, 1);
return PRInt32(PR_MIN(maxBlocks, PR_INT32_MAX)); return PRInt32(PR_MIN(maxBlocks, PR_INT32_MAX));

View File

@ -80,6 +80,9 @@
#include "nsCRT.h" #include "nsCRT.h"
#include "nsXBLEventHandler.h" #include "nsXBLEventHandler.h"
#include "nsEventDispatcher.h" #include "nsEventDispatcher.h"
#include "mozilla/Preferences.h"
using namespace mozilla;
static NS_DEFINE_CID(kDOMScriptObjectFactoryCID, static NS_DEFINE_CID(kDOMScriptObjectFactoryCID,
NS_DOM_SCRIPT_OBJECT_FACTORY_CID); NS_DOM_SCRIPT_OBJECT_FACTORY_CID);
@ -206,8 +209,8 @@ nsXBLPrototypeHandler::InitAccessKeys()
// Get the menu access key value from prefs, overriding the default: // Get the menu access key value from prefs, overriding the default:
kMenuAccessKey = kMenuAccessKey =
nsContentUtils::GetIntPref("ui.key.menuAccessKey", kMenuAccessKey); Preferences::GetInt("ui.key.menuAccessKey", kMenuAccessKey);
kAccelKey = nsContentUtils::GetIntPref("ui.key.accelKey", kAccelKey); kAccelKey = Preferences::GetInt("ui.key.accelKey", kAccelKey);
} }
nsresult nsresult

View File

@ -2580,8 +2580,8 @@ nsGlobalWindow::DialogOpenAttempted()
topWindow->mLastDialogQuitTime); topWindow->mLastDialogQuitTime);
if (dialogDuration.ToSeconds() < if (dialogDuration.ToSeconds() <
nsContentUtils::GetIntPref("dom.successive_dialog_time_limit", Preferences::GetInt("dom.successive_dialog_time_limit",
SUCCESSIVE_DIALOG_TIME_LIMIT)) { SUCCESSIVE_DIALOG_TIME_LIMIT)) {
topWindow->mDialogAbuseCount++; topWindow->mDialogAbuseCount++;
return (topWindow->GetPopupControlState() > openAllowed || return (topWindow->GetPopupControlState() > openAllowed ||
@ -5611,7 +5611,7 @@ nsGlobalWindow::RevisePopupAbuseLevel(PopupControlState aControl)
// limit the number of simultaneously open popups // limit the number of simultaneously open popups
if (abuse == openAbused || abuse == openControlled) { if (abuse == openAbused || abuse == openControlled) {
PRInt32 popupMax = nsContentUtils::GetIntPref("dom.popup_maximum", -1); PRInt32 popupMax = Preferences::GetInt("dom.popup_maximum", -1);
if (popupMax >= 0 && gOpenPopupSpamCount >= popupMax) if (popupMax >= 0 && gOpenPopupSpamCount >= popupMax)
abuse = openOverridden; abuse = openOverridden;
} }
@ -8956,7 +8956,7 @@ nsGlobalWindow::SetTimeoutOrInterval(nsIScriptTimeoutHandler *aHandler,
// "dom.disable_open_click_delay" is set to (in ms). // "dom.disable_open_click_delay" is set to (in ms).
PRInt32 delay = PRInt32 delay =
nsContentUtils::GetIntPref("dom.disable_open_click_delay"); Preferences::GetInt("dom.disable_open_click_delay");
// This is checking |interval|, not realInterval, on purpose, // This is checking |interval|, not realInterval, on purpose,
// because our lower bound for |realInterval| could be pretty high // because our lower bound for |realInterval| could be pretty high
@ -10859,9 +10859,8 @@ NS_IMETHODIMP
nsNavigator::GetCookieEnabled(PRBool *aCookieEnabled) nsNavigator::GetCookieEnabled(PRBool *aCookieEnabled)
{ {
*aCookieEnabled = *aCookieEnabled =
(nsContentUtils::GetIntPref("network.cookie.cookieBehavior", (Preferences::GetInt("network.cookie.cookieBehavior",
COOKIE_BEHAVIOR_REJECT) != COOKIE_BEHAVIOR_REJECT) != COOKIE_BEHAVIOR_REJECT);
COOKIE_BEHAVIOR_REJECT);
return NS_OK; return NS_OK;
} }

View File

@ -1012,7 +1012,7 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
context->mDefaultJSOptions = newDefaultJSOptions; context->mDefaultJSOptions = newDefaultJSOptions;
#ifdef JS_GC_ZEAL #ifdef JS_GC_ZEAL
PRInt32 zeal = nsContentUtils::GetIntPref(js_zeal_option_str, -1); PRInt32 zeal = Preferences::GetInt(js_zeal_option_str, -1);
if (zeal >= 0) if (zeal >= 0)
::JS_SetGCZeal(context->mContext, (PRUint8)zeal); ::JS_SetGCZeal(context->mContext, (PRUint8)zeal);
#endif #endif
@ -3608,7 +3608,7 @@ MaxScriptRunTimePrefChangedCallback(const char *aPrefName, void *aClosure)
// scripts run forever. // scripts run forever.
PRBool isChromePref = PRBool isChromePref =
strcmp(aPrefName, "dom.max_chrome_script_run_time") == 0; strcmp(aPrefName, "dom.max_chrome_script_run_time") == 0;
PRInt32 time = nsContentUtils::GetIntPref(aPrefName, isChromePref ? 20 : 10); PRInt32 time = Preferences::GetInt(aPrefName, isChromePref ? 20 : 10);
PRTime t; PRTime t;
if (time <= 0) { if (time <= 0) {
@ -3638,7 +3638,7 @@ ReportAllJSExceptionsPrefChangedCallback(const char* aPrefName, void* aClosure)
static int static int
SetMemoryHighWaterMarkPrefChangedCallback(const char* aPrefName, void* aClosure) SetMemoryHighWaterMarkPrefChangedCallback(const char* aPrefName, void* aClosure)
{ {
PRInt32 highwatermark = nsContentUtils::GetIntPref(aPrefName, 128); PRInt32 highwatermark = Preferences::GetInt(aPrefName, 128);
JS_SetGCParameter(nsJSRuntime::sRuntime, JSGC_MAX_MALLOC_BYTES, JS_SetGCParameter(nsJSRuntime::sRuntime, JSGC_MAX_MALLOC_BYTES,
highwatermark * 1024L * 1024L); highwatermark * 1024L * 1024L);
@ -3648,7 +3648,7 @@ SetMemoryHighWaterMarkPrefChangedCallback(const char* aPrefName, void* aClosure)
static int static int
SetMemoryMaxPrefChangedCallback(const char* aPrefName, void* aClosure) SetMemoryMaxPrefChangedCallback(const char* aPrefName, void* aClosure)
{ {
PRInt32 pref = nsContentUtils::GetIntPref(aPrefName, -1); PRInt32 pref = Preferences::GetInt(aPrefName, -1);
// handle overflow and negative pref values // handle overflow and negative pref values
PRUint32 max = (pref <= 0 || pref >= 0x1000) ? -1 : (PRUint32)pref * 1024 * 1024; PRUint32 max = (pref <= 0 || pref >= 0x1000) ? -1 : (PRUint32)pref * 1024 * 1024;
JS_SetGCParameter(nsJSRuntime::sRuntime, JSGC_MAX_BYTES, max); JS_SetGCParameter(nsJSRuntime::sRuntime, JSGC_MAX_BYTES, max);

View File

@ -51,6 +51,7 @@
#include "base/process_util.h" #include "base/process_util.h"
#include "mozilla/Preferences.h"
#include "mozilla/unused.h" #include "mozilla/unused.h"
#include "mozilla/ipc/SyncChannel.h" #include "mozilla/ipc/SyncChannel.h"
#include "mozilla/plugins/PluginModuleParent.h" #include "mozilla/plugins/PluginModuleParent.h"
@ -71,6 +72,7 @@ using base::KillProcess;
using mozilla::PluginLibrary; using mozilla::PluginLibrary;
using mozilla::ipc::SyncChannel; using mozilla::ipc::SyncChannel;
using namespace mozilla;
using namespace mozilla::plugins; using namespace mozilla::plugins;
static const char kTimeoutPref[] = "dom.ipc.plugins.timeoutSecs"; static const char kTimeoutPref[] = "dom.ipc.plugins.timeoutSecs";
@ -90,7 +92,7 @@ PluginModuleParent::LoadModule(const char* aFilePath)
{ {
PLUGIN_LOG_DEBUG_FUNCTION; PLUGIN_LOG_DEBUG_FUNCTION;
PRInt32 prefSecs = nsContentUtils::GetIntPref(kLaunchTimeoutPref, 0); PRInt32 prefSecs = Preferences::GetInt(kLaunchTimeoutPref, 0);
// Block on the child process being launched and initialized. // Block on the child process being launched and initialized.
nsAutoPtr<PluginModuleParent> parent(new PluginModuleParent(aFilePath)); nsAutoPtr<PluginModuleParent> parent(new PluginModuleParent(aFilePath));
@ -223,7 +225,7 @@ PluginModuleParent::TimeoutChanged(const char* aPref, void* aModule)
NS_ABORT_IF_FALSE(!strcmp(aPref, kTimeoutPref), NS_ABORT_IF_FALSE(!strcmp(aPref, kTimeoutPref),
"unexpected pref callback"); "unexpected pref callback");
PRInt32 timeoutSecs = nsContentUtils::GetIntPref(kTimeoutPref, 0); PRInt32 timeoutSecs = Preferences::GetInt(kTimeoutPref, 0);
int32 timeoutMs = (timeoutSecs > 0) ? (1000 * timeoutSecs) : int32 timeoutMs = (timeoutSecs > 0) ? (1000 * timeoutSecs) :
SyncChannel::kNoTimeout; SyncChannel::kNoTimeout;

View File

@ -516,7 +516,7 @@ GeoIgnoreLocationFilterChangedCallback(const char *aPrefName, void *aClosure)
nsresult nsGeolocationService::Init() nsresult nsGeolocationService::Init()
{ {
mTimeout = nsContentUtils::GetIntPref("geo.timeout", 6000); mTimeout = Preferences::GetInt("geo.timeout", 6000);
nsContentUtils::RegisterPrefCallback("geo.ignore.location_filter", nsContentUtils::RegisterPrefCallback("geo.ignore.location_filter",
GeoIgnoreLocationFilterChangedCallback, GeoIgnoreLocationFilterChangedCallback,

View File

@ -56,11 +56,14 @@
#include "nsIObserverService.h" #include "nsIObserverService.h"
#include "nsIScriptGlobalObject.h" #include "nsIScriptGlobalObject.h"
#include "nsIWebNavigation.h" #include "nsIWebNavigation.h"
#include "mozilla/Preferences.h"
#include "nsXULAppAPI.h" #include "nsXULAppAPI.h"
#define IS_CHILD_PROCESS() \ #define IS_CHILD_PROCESS() \
(GeckoProcessType_Default != XRE_GetProcessType()) (GeckoProcessType_Default != XRE_GetProcessType())
using namespace mozilla;
// Event names // Event names
#define CHECKING_STR "checking" #define CHECKING_STR "checking"
@ -392,8 +395,8 @@ nsDOMOfflineResourceList::MozAdd(const nsAString& aURI)
PRUint32 length; PRUint32 length;
rv = GetMozLength(&length); rv = GetMozLength(&length);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
PRUint32 maxEntries = nsContentUtils::GetIntPref(kMaxEntriesPref, PRUint32 maxEntries =
DEFAULT_MAX_ENTRIES); Preferences::GetUint(kMaxEntriesPref, DEFAULT_MAX_ENTRIES);
if (length > maxEntries) return NS_ERROR_NOT_AVAILABLE; if (length > maxEntries) return NS_ERROR_NOT_AVAILABLE;

View File

@ -205,22 +205,21 @@ GetQuota(const nsACString &aDomain, PRInt32 *aQuota, PRInt32 *aWarnQuota,
PRUint32 perm = GetOfflinePermission(aDomain); PRUint32 perm = GetOfflinePermission(aDomain);
if (IS_PERMISSION_ALLOWED(perm) || aOverrideQuota) { if (IS_PERMISSION_ALLOWED(perm) || aOverrideQuota) {
// This is an offline app, give more space by default. // This is an offline app, give more space by default.
*aQuota = ((PRInt32)nsContentUtils::GetIntPref(kOfflineAppQuota, *aQuota = Preferences::GetInt(kOfflineAppQuota,
DEFAULT_OFFLINE_APP_QUOTA) * 1024); DEFAULT_OFFLINE_APP_QUOTA) * 1024;
if (perm == nsIOfflineCacheUpdateService::ALLOW_NO_WARN || if (perm == nsIOfflineCacheUpdateService::ALLOW_NO_WARN ||
aOverrideQuota) { aOverrideQuota) {
*aWarnQuota = -1; *aWarnQuota = -1;
} else { } else {
*aWarnQuota = ((PRInt32)nsContentUtils::GetIntPref(kOfflineAppWarnQuota, *aWarnQuota = Preferences::GetInt(kOfflineAppWarnQuota,
DEFAULT_OFFLINE_WARN_QUOTA) * 1024); DEFAULT_OFFLINE_WARN_QUOTA) * 1024;
} }
return perm; return perm;
} }
// FIXME: per-domain quotas? // FIXME: per-domain quotas?
*aQuota = ((PRInt32)nsContentUtils::GetIntPref(kDefaultQuota, *aQuota = Preferences::GetInt(kDefaultQuota, DEFAULT_QUOTA) * 1024;
DEFAULT_QUOTA) * 1024);
*aWarnQuota = -1; *aWarnQuota = -1;
return perm; return perm;
@ -1504,8 +1503,8 @@ nsDOMStorage::CanUseStorage(PRPackedBool* aSessionOnly)
*aSessionOnly = PR_TRUE; *aSessionOnly = PR_TRUE;
} }
else if (perm != nsIPermissionManager::ALLOW_ACTION) { else if (perm != nsIPermissionManager::ALLOW_ACTION) {
PRUint32 cookieBehavior = nsContentUtils::GetIntPref(kCookiesBehavior); PRUint32 cookieBehavior = Preferences::GetUint(kCookiesBehavior);
PRUint32 lifetimePolicy = nsContentUtils::GetIntPref(kCookiesLifetimePolicy); PRUint32 lifetimePolicy = Preferences::GetUint(kCookiesLifetimePolicy);
// Treat "ask every time" as "reject always". // Treat "ask every time" as "reject always".
// Chrome persistent pages can bypass this check. // Chrome persistent pages can bypass this check.

View File

@ -71,6 +71,7 @@
#include "nsXPCOMCIDInternal.h" #include "nsXPCOMCIDInternal.h"
#include "pratom.h" #include "pratom.h"
#include "prthread.h" #include "prthread.h"
#include "mozilla/Preferences.h"
// DOMWorker includes // DOMWorker includes
#include "nsDOMWorker.h" #include "nsDOMWorker.h"
@ -1593,7 +1594,7 @@ nsDOMThreadService::PrefCallback(const char* aPrefName,
// some wacky platform then the worst that could happen is that the close // some wacky platform then the worst that could happen is that the close
// handler will run for a slightly different amount of time. // handler will run for a slightly different amount of time.
PRUint32 timeoutMS = PRUint32 timeoutMS =
nsContentUtils::GetIntPref(aPrefName, gWorkerCloseHandlerTimeoutMS); Preferences::GetUint(aPrefName, gWorkerCloseHandlerTimeoutMS);
// We must have a timeout value, 0 is not ok. If the pref is set to 0 then // We must have a timeout value, 0 is not ok. If the pref is set to 0 then
// fall back to our default. // fall back to our default.

View File

@ -79,6 +79,7 @@
#include "nsEventDispatcher.h" #include "nsEventDispatcher.h"
#include "nsGkAtoms.h" #include "nsGkAtoms.h"
#include "nsDebug.h" #include "nsDebug.h"
#include "mozilla/Preferences.h"
// Drag & Drop, Clipboard // Drag & Drop, Clipboard
#include "nsIClipboard.h" #include "nsIClipboard.h"
@ -87,6 +88,8 @@
#include "mozilla/FunctionTimer.h" #include "mozilla/FunctionTimer.h"
using namespace mozilla;
nsPlaintextEditor::nsPlaintextEditor() nsPlaintextEditor::nsPlaintextEditor()
: nsEditor() : nsEditor()
, mIgnoreSpuriousDragEvent(PR_FALSE) , mIgnoreSpuriousDragEvent(PR_FALSE)
@ -171,10 +174,11 @@ static int
EditorPrefsChangedCallback(const char *aPrefName, void *) EditorPrefsChangedCallback(const char *aPrefName, void *)
{ {
if (nsCRT::strcmp(aPrefName, "editor.singleLine.pasteNewlines") == 0) { if (nsCRT::strcmp(aPrefName, "editor.singleLine.pasteNewlines") == 0) {
sNewlineHandlingPref = nsContentUtils::GetIntPref("editor.singleLine.pasteNewlines", sNewlineHandlingPref =
nsIPlaintextEditor::eNewlinesPasteToFirst); Preferences::GetInt("editor.singleLine.pasteNewlines",
nsIPlaintextEditor::eNewlinesPasteToFirst);
} else if (nsCRT::strcmp(aPrefName, "layout.selection.caret_style") == 0) { } else if (nsCRT::strcmp(aPrefName, "layout.selection.caret_style") == 0) {
sCaretStylePref = nsContentUtils::GetIntPref("layout.selection.caret_style", sCaretStylePref = Preferences::GetInt("layout.selection.caret_style",
#ifdef XP_WIN #ifdef XP_WIN
1); 1);
if (sCaretStylePref == 0) if (sCaretStylePref == 0)

View File

@ -491,7 +491,7 @@ nsPresContext::GetFontPreferences()
pref.Assign("font.minimum-size."); pref.Assign("font.minimum-size.");
pref.Append(langGroup); pref.Append(langGroup);
PRInt32 size = nsContentUtils::GetIntPref(pref.get()); PRInt32 size = Preferences::GetInt(pref.get());
if (unit == eUnit_px) { if (unit == eUnit_px) {
mMinimumFontSizePref = CSSPixelsToAppUnits(size); mMinimumFontSizePref = CSSPixelsToAppUnits(size);
} }
@ -557,7 +557,7 @@ nsPresContext::GetFontPreferences()
// get font.size.[generic].[langGroup] // get font.size.[generic].[langGroup]
// size=0 means 'Auto', i.e., generic fonts retain the size of the variable font // size=0 means 'Auto', i.e., generic fonts retain the size of the variable font
MAKE_FONT_PREF_KEY(pref, "font.size", generic_dot_langGroup); MAKE_FONT_PREF_KEY(pref, "font.size", generic_dot_langGroup);
size = nsContentUtils::GetIntPref(pref.get()); size = Preferences::GetInt(pref.get());
if (size > 0) { if (size > 0) {
if (unit == eUnit_px) { if (unit == eUnit_px) {
font->size = CSSPixelsToAppUnits(size); font->size = CSSPixelsToAppUnits(size);
@ -651,12 +651,11 @@ nsPresContext::GetUserPreferences()
} }
mFontScaler = mFontScaler =
nsContentUtils::GetIntPref("browser.display.base_font_scaler", Preferences::GetInt("browser.display.base_font_scaler", mFontScaler);
mFontScaler);
mAutoQualityMinFontSizePixelsPref = mAutoQualityMinFontSizePixelsPref =
nsContentUtils::GetIntPref("browser.display.auto_quality_min_font_size"); Preferences::GetInt("browser.display.auto_quality_min_font_size");
// * document colors // * document colors
GetDocumentColorPreferences(); GetDocumentColorPreferences();
@ -709,26 +708,23 @@ nsPresContext::GetUserPreferences()
} }
mFocusRingWidth = mFocusRingWidth =
nsContentUtils::GetIntPref("browser.display.focus_ring_width", Preferences::GetInt("browser.display.focus_ring_width", mFocusRingWidth);
mFocusRingWidth);
mFocusRingOnAnything = mFocusRingOnAnything =
Preferences::GetBool("browser.display.focus_ring_on_anything", Preferences::GetBool("browser.display.focus_ring_on_anything",
mFocusRingOnAnything); mFocusRingOnAnything);
mFocusRingStyle = mFocusRingStyle =
nsContentUtils::GetIntPref("browser.display.focus_ring_style", Preferences::GetInt("browser.display.focus_ring_style", mFocusRingStyle);
mFocusRingStyle);
// * use fonts? // * use fonts?
mUseDocumentFonts = mUseDocumentFonts =
nsContentUtils::GetIntPref("browser.display.use_document_fonts") != 0; Preferences::GetInt("browser.display.use_document_fonts") != 0;
// * replace backslashes with Yen signs? (bug 245770) // * replace backslashes with Yen signs? (bug 245770)
mEnableJapaneseTransform = mEnableJapaneseTransform =
Preferences::GetBool("layout.enable_japanese_specific_transform"); Preferences::GetBool("layout.enable_japanese_specific_transform");
mPrefScrollbarSide = mPrefScrollbarSide = Preferences::GetInt("layout.scrollbar.side");
nsContentUtils::GetIntPref("layout.scrollbar.side");
GetFontPreferences(); GetFontPreferences();
@ -747,24 +743,24 @@ nsPresContext::GetUserPreferences()
PRUint32 bidiOptions = GetBidi(); PRUint32 bidiOptions = GetBidi();
PRInt32 prefInt = PRInt32 prefInt =
nsContentUtils::GetIntPref(IBMBIDI_TEXTDIRECTION_STR, Preferences::GetInt(IBMBIDI_TEXTDIRECTION_STR,
GET_BIDI_OPTION_DIRECTION(bidiOptions)); GET_BIDI_OPTION_DIRECTION(bidiOptions));
SET_BIDI_OPTION_DIRECTION(bidiOptions, prefInt); SET_BIDI_OPTION_DIRECTION(bidiOptions, prefInt);
mPrefBidiDirection = prefInt; mPrefBidiDirection = prefInt;
prefInt = prefInt =
nsContentUtils::GetIntPref(IBMBIDI_TEXTTYPE_STR, Preferences::GetInt(IBMBIDI_TEXTTYPE_STR,
GET_BIDI_OPTION_TEXTTYPE(bidiOptions)); GET_BIDI_OPTION_TEXTTYPE(bidiOptions));
SET_BIDI_OPTION_TEXTTYPE(bidiOptions, prefInt); SET_BIDI_OPTION_TEXTTYPE(bidiOptions, prefInt);
prefInt = prefInt =
nsContentUtils::GetIntPref(IBMBIDI_NUMERAL_STR, Preferences::GetInt(IBMBIDI_NUMERAL_STR,
GET_BIDI_OPTION_NUMERAL(bidiOptions)); GET_BIDI_OPTION_NUMERAL(bidiOptions));
SET_BIDI_OPTION_NUMERAL(bidiOptions, prefInt); SET_BIDI_OPTION_NUMERAL(bidiOptions, prefInt);
prefInt = prefInt =
nsContentUtils::GetIntPref(IBMBIDI_SUPPORTMODE_STR, Preferences::GetInt(IBMBIDI_SUPPORTMODE_STR,
GET_BIDI_OPTION_SUPPORT(bidiOptions)); GET_BIDI_OPTION_SUPPORT(bidiOptions));
SET_BIDI_OPTION_SUPPORT(bidiOptions, prefInt); SET_BIDI_OPTION_SUPPORT(bidiOptions, prefInt);
// We don't need to force reflow: either we are initializing a new // We don't need to force reflow: either we are initializing a new

View File

@ -1860,8 +1860,7 @@ PresShell::Init(nsIDocument* aDocument,
if (gMaxRCProcessingTime == -1) { if (gMaxRCProcessingTime == -1) {
gMaxRCProcessingTime = gMaxRCProcessingTime =
nsContentUtils::GetIntPref("layout.reflow.timeslice", Preferences::GetInt("layout.reflow.timeslice", NS_MAX_REFLOW_TIME);
NS_MAX_REFLOW_TIME);
} }
{ {
@ -2817,8 +2816,8 @@ PresShell::InitialReflow(nscoord aWidth, nscoord aHeight)
// Default to PAINTLOCK_EVENT_DELAY if we can't get the pref value. // Default to PAINTLOCK_EVENT_DELAY if we can't get the pref value.
PRInt32 delay = PRInt32 delay =
nsContentUtils::GetIntPref("nglayout.initialpaint.delay", Preferences::GetInt("nglayout.initialpaint.delay",
PAINTLOCK_EVENT_DELAY); PAINTLOCK_EVENT_DELAY);
mPaintSuppressionTimer->InitWithFuncCallback(sPaintSuppressionCallback, mPaintSuppressionTimer->InitWithFuncCallback(sPaintSuppressionCallback,
this, delay, this, delay,

View File

@ -52,10 +52,13 @@
#include "nsEventDispatcher.h" #include "nsEventDispatcher.h"
#include "jsapi.h" #include "jsapi.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "mozilla/Preferences.h"
using mozilla::TimeStamp; using mozilla::TimeStamp;
using mozilla::TimeDuration; using mozilla::TimeDuration;
using namespace mozilla;
#define DEFAULT_FRAME_RATE 60 #define DEFAULT_FRAME_RATE 60
#define DEFAULT_THROTTLED_FRAME_RATE 1 #define DEFAULT_THROTTLED_FRAME_RATE 1
@ -75,7 +78,7 @@ nsRefreshDriver::GetRefreshTimerInterval() const
{ {
const char* prefName = const char* prefName =
mThrottled ? "layout.throttled_frame_rate" : "layout.frame_rate"; mThrottled ? "layout.throttled_frame_rate" : "layout.frame_rate";
PRInt32 rate = nsContentUtils::GetIntPref(prefName, -1); PRInt32 rate = Preferences::GetInt(prefName, -1);
if (rate <= 0) { if (rate <= 0) {
// TODO: get the rate from the platform // TODO: get the rate from the platform
rate = mThrottled ? DEFAULT_THROTTLED_FRAME_RATE : DEFAULT_FRAME_RATE; rate = mThrottled ? DEFAULT_THROTTLED_FRAME_RATE : DEFAULT_FRAME_RATE;

View File

@ -2926,7 +2926,7 @@ static FrameTarget GetSelectionClosestFrameForBlock(nsIFrame* aFrame,
// up with a line or the beginning or end of the frame; 0 on Windows, // up with a line or the beginning or end of the frame; 0 on Windows,
// 1 on other platforms by default at the writing of this code // 1 on other platforms by default at the writing of this code
PRInt32 dragOutOfFrame = PRInt32 dragOutOfFrame =
nsContentUtils::GetIntPref("browser.drag_out_of_frame_style"); Preferences::GetInt("browser.drag_out_of_frame_style");
if (prevLine == end) { if (prevLine == end) {
if (dragOutOfFrame == 1 || nextLine == end) if (dragOutOfFrame == 1 || nextLine == end)

View File

@ -1639,9 +1639,10 @@ static eNormalLineHeightControl GetNormalLineHeightCalcControl(void)
if (sNormalLineHeightControl == eUninitialized) { if (sNormalLineHeightControl == eUninitialized) {
// browser.display.normal_lineheight_calc_control is not user // browser.display.normal_lineheight_calc_control is not user
// changeable, so no need to register callback for it. // changeable, so no need to register callback for it.
sNormalLineHeightControl = PRInt32 val =
static_cast<eNormalLineHeightControl> Preferences::GetInt("browser.display.normal_lineheight_calc_control",
(nsContentUtils::GetIntPref("browser.display.normal_lineheight_calc_control", eNoExternalLeading)); eNoExternalLeading);
sNormalLineHeightControl = static_cast<eNormalLineHeightControl>(val);
} }
return sNormalLineHeightControl; return sNormalLineHeightControl;
} }

View File

@ -133,6 +133,7 @@ enum { XKeyPress = KeyPress };
#include "nsComponentManagerUtils.h" #include "nsComponentManagerUtils.h"
#include "nsIObserverService.h" #include "nsIObserverService.h"
#include "nsIScrollableFrame.h" #include "nsIScrollableFrame.h"
#include "mozilla/Preferences.h"
// headers for plugin scriptability // headers for plugin scriptability
#include "nsIScriptGlobalObject.h" #include "nsIScriptGlobalObject.h"
@ -3373,7 +3374,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetURL(const char *aURL,
} }
PRInt32 blockPopups = PRInt32 blockPopups =
nsContentUtils::GetIntPref("privacy.popups.disable_from_plugins"); Preferences::GetInt("privacy.popups.disable_from_plugins");
nsAutoPopupStatePusher popupStatePusher((PopupControlState)blockPopups); nsAutoPopupStatePusher popupStatePusher((PopupControlState)blockPopups);
rv = lh->OnLinkClick(mContent, uri, unitarget.get(), rv = lh->OnLinkClick(mContent, uri, unitarget.get(),

View File

@ -1084,7 +1084,8 @@ nsFrameSelection::Init(nsIPresShell *aShell, nsIContent *aLimiter)
mMouseDownState = PR_FALSE; mMouseDownState = PR_FALSE;
mDesiredXSet = PR_FALSE; mDesiredXSet = PR_FALSE;
mLimiter = aLimiter; mLimiter = aLimiter;
mCaretMovementStyle = nsContentUtils::GetIntPref("bidi.edit.caret_movement_style", 2); mCaretMovementStyle =
Preferences::GetInt("bidi.edit.caret_movement_style", 2);
} }
nsresult nsresult
@ -1143,7 +1144,8 @@ nsFrameSelection::MoveCaret(PRUint32 aKeycode,
SetDesiredX(desiredX); SetDesiredX(desiredX);
} }
PRInt32 caretStyle = nsContentUtils::GetIntPref("layout.selection.caret_style", 0); PRInt32 caretStyle =
Preferences::GetInt("layout.selection.caret_style", 0);
#ifdef XP_MACOSX #ifdef XP_MACOSX
if (caretStyle == 0) { if (caretStyle == 0) {
caretStyle = 2; // put caret at the selection edge in the |aKeycode| direction caretStyle = 2; // put caret at the selection edge in the |aKeycode| direction

View File

@ -49,6 +49,7 @@
#include "nsCSSFrameConstructor.h" #include "nsCSSFrameConstructor.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsDisplayList.h" #include "nsDisplayList.h"
#include "mozilla/Preferences.h"
// DateTime Includes // DateTime Includes
#include "nsDateTimeFormatCID.h" #include "nsDateTimeFormatCID.h"
@ -61,6 +62,8 @@
#include "nsGfxCIID.h" #include "nsGfxCIID.h"
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
using namespace mozilla;
static const char sPrintOptionsContractID[] = "@mozilla.org/gfx/printsettings-service;1"; static const char sPrintOptionsContractID[] = "@mozilla.org/gfx/printsettings-service;1";
// //
@ -226,7 +229,7 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
// Compute the size of each page and the x coordinate that each page will // Compute the size of each page and the x coordinate that each page will
// be placed at // be placed at
nscoord extraThreshold = NS_MAX(pageSize.width, pageSize.height)/10; nscoord extraThreshold = NS_MAX(pageSize.width, pageSize.height)/10;
PRInt32 gapInTwips = nsContentUtils::GetIntPref("print.print_extra_margin"); PRInt32 gapInTwips = Preferences::GetInt("print.print_extra_margin");
gapInTwips = NS_MAX(0, gapInTwips); gapInTwips = NS_MAX(0, gapInTwips);
nscoord extraGap = aPresContext->CSSTwipsToAppUnits(gapInTwips); nscoord extraGap = aPresContext->CSSTwipsToAppUnits(gapInTwips);

View File

@ -123,7 +123,7 @@ void nsMenuBarListener::InitAccessKey()
#endif #endif
// Get the menu access key value from prefs, overriding the default: // Get the menu access key value from prefs, overriding the default:
mAccessKey = nsContentUtils::GetIntPref("ui.key.menuAccessKey", mAccessKey); mAccessKey = Preferences::GetInt("ui.key.menuAccessKey", mAccessKey);
if (mAccessKey == nsIDOMKeyEvent::DOM_VK_SHIFT) if (mAccessKey == nsIDOMKeyEvent::DOM_VK_SHIFT)
mAccessKeyMask = MODIFIER_SHIFT; mAccessKeyMask = MODIFIER_SHIFT;
else if (mAccessKey == nsIDOMKeyEvent::DOM_VK_CONTROL) else if (mAccessKey == nsIDOMKeyEvent::DOM_VK_CONTROL)

View File

@ -83,6 +83,9 @@
#include "nsEventStateManager.h" #include "nsEventStateManager.h"
#include "nsIDOMXULMenuListElement.h" #include "nsIDOMXULMenuListElement.h"
#include "mozilla/Services.h" #include "mozilla/Services.h"
#include "mozilla/Preferences.h"
using namespace mozilla;
#define NS_MENU_POPUP_LIST_INDEX 0 #define NS_MENU_POPUP_LIST_INDEX 0
@ -1118,7 +1121,7 @@ nsMenuFrame::BuildAcceleratorText(PRBool aNotify)
#endif #endif
// Get the accelerator key value from prefs, overriding the default: // Get the accelerator key value from prefs, overriding the default:
accelKey = nsContentUtils::GetIntPref("ui.key.accelKey", accelKey); accelKey = Preferences::GetInt("ui.key.accelKey", accelKey);
} }
nsAutoString modifiers; nsAutoString modifiers;

View File

@ -121,7 +121,7 @@ nsSliderFrame::Init(nsIContent* aContent,
gotPrefs = PR_TRUE; gotPrefs = PR_TRUE;
gMiddlePref = Preferences::GetBool("middlemouse.scrollbarPosition"); gMiddlePref = Preferences::GetBool("middlemouse.scrollbarPosition");
gSnapMultiplier = nsContentUtils::GetIntPref("slider.snapMultiplier"); gSnapMultiplier = Preferences::GetInt("slider.snapMultiplier");
} }
mCurPos = GetCurrentPosition(aContent); mCurPos = GetCurrentPosition(aContent);