Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Unified Diff: ui/accessibility/platform/atk_util_auralinux.cc

Issue 1993763002: Revert of Fix hanging on browser shutdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/accessibility/platform/atk_util_auralinux.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « ui/accessibility/platform/atk_util_auralinux.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698