Index: ui/accessibility/platform/atk_util_auralinux.cc |
diff --git a/ui/accessibility/platform/atk_util_auralinux.cc b/ui/accessibility/platform/atk_util_auralinux.cc |
index 98e98dff1698acd2f21e282cc5771f1a5fe05431..46ad3be53be8341c11e50c91f17197f360e8b567 100644 |
--- a/ui/accessibility/platform/atk_util_auralinux.cc |
+++ b/ui/accessibility/platform/atk_util_auralinux.cc |
@@ -53,45 +53,7 @@ |
const char kGnomeAccessibilityEnabledKey[] = |
"/desktop/gnome/interface/accessibility"; |
-bool PlatformShouldEnableAccessibility() { |
- GConfClient* client = gconf_client_get_default(); |
- if (!client) { |
- LOG(ERROR) << "gconf_client_get_default failed"; |
- return false; |
- } |
- |
- GError* error = nullptr; |
- gboolean value = gconf_client_get_bool(client, |
- kGnomeAccessibilityEnabledKey, |
- &error); |
- g_object_unref(client); |
- |
- if (error) { |
- VLOG(1) << "gconf_client_get_bool failed"; |
- g_error_free(error); |
- return false; |
- } |
- |
- return value; |
-} |
- |
-#else // !defined(USE_GCONF) |
- |
-bool PlatformShouldEnableAccessibility() { |
- // TODO(iceman): implement this for non-GNOME desktops. |
- return false; |
-} |
- |
-#endif // defined(USE_GCONF) |
- |
-bool ShouldEnableAccessibility() { |
- char* enable_accessibility = getenv(kAccessibilityEnabled); |
- if ((enable_accessibility && atoi(enable_accessibility) == 1) || |
- PlatformShouldEnableAccessibility()) |
- return true; |
- |
- return false; |
-} |
+#endif |
} // namespace |
@@ -199,9 +161,6 @@ |
// Register our util class. |
g_type_class_unref(g_type_class_ref(ATK_UTIL_AURALINUX_TYPE)); |
- if (!ShouldEnableAccessibility()) |
- return; |
- |
init_task_runner->PostTaskAndReply( |
FROM_HERE, |
base::Bind( |
@@ -218,7 +177,33 @@ |
#if defined(USE_GCONF) |
void AtkUtilAuraLinux::CheckIfAccessibilityIsEnabledOnFileThread() { |
- is_enabled_ = AccessibilityModuleInitOnFileThread(); |
+ char* enable_accessibility = getenv(kAccessibilityEnabled); |
+ if ((enable_accessibility && atoi(enable_accessibility) == 1) || |
+ CheckPlatformAccessibilitySupportOnFileThread()) |
+ is_enabled_ = AccessibilityModuleInitOnFileThread(); |
+} |
+ |
+bool AtkUtilAuraLinux::CheckPlatformAccessibilitySupportOnFileThread() { |
+ GConfClient* client = gconf_client_get_default(); |
+ if (!client) { |
+ LOG(ERROR) << "gconf_client_get_default failed"; |
+ return false; |
+ } |
+ |
+ GError* error = nullptr; |
+ bool is_enabled = gconf_client_get_bool(client, |
+ kGnomeAccessibilityEnabledKey, |
+ &error); |
+ |
+ g_object_unref(client); |
+ |
+ if (error) { |
+ VLOG(1) << "gconf_client_get_bool failed"; |
+ g_error_free(error); |
+ return false; |
+ } |
+ |
+ return is_enabled; |
} |
void AtkUtilAuraLinux::FinishAccessibilityInitOnUIThread() { |