Bug 474825 - honor mozilla.widget.disable-native-theme preference. move preference check to the right place r=stuart

This commit is contained in:
Vladimir Vukicevic 2009-02-18 10:38:37 -08:00
parent ede7e6d142
commit a4f3879420
2 changed files with 7 additions and 32 deletions

View File

@ -78,38 +78,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsLookAndFeel)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsToolkit)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerWin)
// from nsWindow.cpp
extern PRBool gDisableNativeTheme;
static NS_IMETHODIMP
nsNativeThemeWinConstructor(nsISupports *aOuter, REFNSIID aIID,
void **aResult)
{
nsresult rv;
nsNativeThemeWin * inst;
if (gDisableNativeTheme)
return NS_ERROR_NO_INTERFACE;
*aResult = NULL;
if (NULL != aOuter) {
rv = NS_ERROR_NO_AGGREGATION;
return rv;
}
NS_NEWXPCOM(inst, nsNativeThemeWin);
if (NULL == inst) {
rv = NS_ERROR_OUT_OF_MEMORY;
return rv;
}
NS_ADDREF(inst);
rv = inst->QueryInterface(aIID, aResult);
NS_RELEASE(inst);
return rv;
}
#ifndef WINCE
NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper)

View File

@ -2771,8 +2771,15 @@ nsNativeThemeWin::GetWidgetNativeDrawingFlags(PRUint8 aWidgetType)
///////////////////////////////////////////
// Creation Routine
///////////////////////////////////////////
// from nsWindow.cpp
extern PRBool gDisableNativeTheme;
NS_METHOD NS_NewNativeTheme(nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
if (gDisableNativeTheme)
return NS_ERROR_NO_INTERFACE;
if (aOuter)
return NS_ERROR_NO_AGGREGATION;