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

Unified Diff: Source/core/accessibility/AXObjectCache.cpp

Issue 495763005: Switch to using accessibilityEnabled and inlineTextBoxAccessibilityEnabled from settings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 4 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 | « Source/core/accessibility/AXObjectCache.h ('k') | Source/core/accessibility/AXRenderObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/accessibility/AXObjectCache.cpp
diff --git a/Source/core/accessibility/AXObjectCache.cpp b/Source/core/accessibility/AXObjectCache.cpp
index a191a36d75e0a4508ae487eddf50a12f4e16c934..4b0e02f8108e4f5eb576f9d0d511dbc825bfe8ea 100644
--- a/Source/core/accessibility/AXObjectCache.cpp
+++ b/Source/core/accessibility/AXObjectCache.cpp
@@ -57,6 +57,7 @@
#include "core/accessibility/AXTableRow.h"
#include "core/dom/Document.h"
#include "core/frame/LocalFrame.h"
+#include "core/frame/Settings.h"
#include "core/html/HTMLAreaElement.h"
#include "core/html/HTMLImageElement.h"
#include "core/html/HTMLInputElement.h"
@@ -104,9 +105,6 @@ void AXComputedObjectAttributeCache::clear()
m_idMapping.clear();
}
-bool AXObjectCache::gAccessibilityEnabled = false;
-bool AXObjectCache::gInlineTextBoxAccessibility = false;
-
AXObjectCache::AXObjectCache(Document& document)
: m_document(document)
, m_notificationPostTimer(this, &AXObjectCache::notificationPostTimerFired)
@@ -158,7 +156,7 @@ AXObject* AXObjectCache::focusedImageMapUIElement(HTMLAreaElement* areaElement)
AXObject* AXObjectCache::focusedUIElementForPage(const Page* page)
{
- if (!gAccessibilityEnabled)
+ if (!page->settings().accessibilityEnabled())
return 0;
// Cross-process accessibility is not yet implemented.
@@ -451,7 +449,7 @@ AXObject* AXObjectCache::getOrCreate(AbstractInlineTextBox* inlineTextBox)
AXObject* AXObjectCache::rootObject()
{
- if (!gAccessibilityEnabled)
+ if (!accessibilityEnabled())
return 0;
return getOrCreate(m_document.view());
@@ -900,7 +898,7 @@ void AXObjectCache::recomputeIsIgnored(RenderObject* renderer)
void AXObjectCache::inlineTextBoxesUpdated(RenderObject* renderer)
{
- if (!gInlineTextBoxAccessibility)
+ if (!inlineTextBoxAccessibilityEnabled())
return;
// Only update if the accessibility object already exists and it's
@@ -913,6 +911,27 @@ void AXObjectCache::inlineTextBoxesUpdated(RenderObject* renderer)
}
}
+Settings* AXObjectCache::settings()
+{
+ return m_document.settings();
+}
+
+bool AXObjectCache::accessibilityEnabled()
+{
+ Settings* settings = this->settings();
+ if (!settings)
+ return false;
+ return settings->accessibilityEnabled();
+}
+
+bool AXObjectCache::inlineTextBoxAccessibilityEnabled()
+{
+ Settings* settings = this->settings();
+ if (!settings)
+ return false;
+ return settings->inlineTextBoxAccessibilityEnabled();
+}
+
const Element* AXObjectCache::rootAXEditableElement(const Node* node)
{
const Element* result = node->rootEditableElement();
« no previous file with comments | « Source/core/accessibility/AXObjectCache.h ('k') | Source/core/accessibility/AXRenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698