bug 705983 always check gconf for accessibility state when GNOME_ACCESSIBILITY not set r=ginn.chen

This commit is contained in:
Trevor Saunders 2011-12-01 18:30:55 -05:00
parent 1c103a2b35
commit 1b2ce620b0
3 changed files with 9 additions and 32 deletions

View File

@ -44,7 +44,6 @@
#include "nsMai.h"
#include "prlink.h"
#include "prenv.h"
#include "mozilla/Preferences.h"
#include "nsIGConfService.h"
#include "nsIServiceManager.h"
#include "nsAutoPtr.h"
@ -64,10 +63,6 @@ static const char sATKLibName[] = "libatk-1.0.so.0";
static const char sATKHyperlinkImplGetTypeSymbol[] =
"atk_hyperlink_impl_get_type";
static const char sAccEnv [] = "GNOME_ACCESSIBILITY";
static const char sUseSystemPrefsKey[] =
"config.use_system_prefs";
static const char sAccessibilityKey [] =
"config.use_system_prefs.accessibility";
static const char sGconfAccessibilityKey[] =
"/desktop/gnome/interface/accessibility";
@ -630,18 +625,13 @@ nsApplicationAccessibleWrap::Init()
isGnomeATEnabled = !!atoi(envValue);
} else {
//check gconf-2 setting
if (Preferences::GetBool(sUseSystemPrefsKey, false)) {
nsresult rv;
nsCOMPtr<nsIGConfService> gconf =
do_GetService(NS_GCONFSERVICE_CONTRACTID, &rv);
if (NS_SUCCEEDED(rv) && gconf) {
gconf->GetBool(NS_LITERAL_CSTRING(sGconfAccessibilityKey),
&isGnomeATEnabled);
}
} else {
isGnomeATEnabled =
Preferences::GetBool(sAccessibilityKey, false);
}
nsresult rv;
nsCOMPtr<nsIGConfService> gconf =
do_GetService(NS_GCONFSERVICE_CONTRACTID, &rv);
if (NS_SUCCEEDED(rv) && gconf) {
gconf->GetBool(NS_LITERAL_CSTRING(sGconfAccessibilityKey),
&isGnomeATEnabled);
}
}
if (isGnomeATEnabled) {

View File

@ -1436,12 +1436,6 @@ pref("browser.popups.showPopupBlocker", true);
// See http://bugzilla.mozilla.org/show_bug.cgi?id=169483 for further details...
pref("viewmanager.do_doublebuffering", true);
// whether use prefs from system
pref("config.use_system_prefs", false);
// if the system has enabled accessibility
pref("config.use_system_prefs.accessibility", false);
// enable single finger gesture input (win7+ tablets)
pref("gestures.enable_single_finger_input", true);

View File

@ -121,8 +121,6 @@ static bool sAccessibilityChecked = false;
/* static */
bool nsWindow::sAccessibilityEnabled = false;
static const char sAccEnv [] = "GNOME_ACCESSIBILITY";
static const char sUseSystemPrefsKey[] = "config.use_system_prefs";
static const char sAccessibilityKey [] = "config.use_system_prefs.accessibility";
static const char sGconfAccessibilityKey[] = "/desktop/gnome/interface/accessibility";
#endif
@ -4341,9 +4339,8 @@ nsWindow::Create(nsIWidget *aParent,
if (envValue) {
sAccessibilityEnabled = atoi(envValue) != 0;
LOG(("Accessibility Env %s=%s\n", sAccEnv, envValue));
}
//check gconf-2 setting
else if (Preferences::GetBool(sUseSystemPrefsKey, false)) {
} else {
//check gconf-2 setting
nsCOMPtr<nsIGConfService> gconf =
do_GetService(NS_GCONFSERVICE_CONTRACTID, &rv);
if (NS_SUCCEEDED(rv) && gconf) {
@ -4353,10 +4350,6 @@ nsWindow::Create(nsIWidget *aParent,
gconf->GetBool(NS_LITERAL_CSTRING(sGconfAccessibilityKey),
&sAccessibilityEnabled);
}
} else {
sAccessibilityEnabled =
Preferences::GetBool(sAccessibilityKey, false);
}
}
#endif