Bug 754866 - Make mozilla.widget.disable-native-theme export shared bool across widgets. r=roc

This commit is contained in:
Oleg Romashin
2012-05-15 09:01:48 -04:00
parent 47b7e7d752
commit e318d2e79b
4 changed files with 11 additions and 18 deletions

View File

@@ -77,6 +77,9 @@ using base::Thread;
using mozilla::ipc::AsyncChannel;
nsIContent* nsBaseWidget::mLastRollup = nsnull;
// Global user preference for disabling native theme. Used
// in NativeWindowTheme.
bool gDisableNativeTheme = false;
// nsBaseWidget
NS_IMPL_ISUPPORTS1(nsBaseWidget, nsIWidget)
@@ -204,6 +207,14 @@ void nsBaseWidget::BaseCreate(nsIWidget *aParent,
nsDeviceContext *aContext,
nsWidgetInitData *aInitData)
{
static bool gDisableNativeThemeCached = false;
if (!gDisableNativeThemeCached) {
mozilla::Preferences::AddBoolVarCache(&gDisableNativeTheme,
"mozilla.widget.disable-native-theme",
gDisableNativeTheme);
gDisableNativeThemeCached = true;
}
// save the event callback function
mEventCallback = aHandleEventFunction;