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

Unified Diff: content/renderer/renderer_accessibility.h

Issue 9939011: Add an accessibility mode for editable text fields only. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments and rebased. Created 8 years, 8 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
Index: content/renderer/renderer_accessibility.h
diff --git a/content/renderer/renderer_accessibility.h b/content/renderer/renderer_accessibility.h
index 835a00f93ca50fea67a403e8a8894c2853ca2ae6..e7dd1dc11ee4b09f24ec7fedd7bffc28c010e785 100644
--- a/content/renderer/renderer_accessibility.h
+++ b/content/renderer/renderer_accessibility.h
@@ -10,6 +10,7 @@
#include "base/hash_tables.h"
#include "base/memory/weak_ptr.h"
+#include "content/common/accessibility_messages.h"
#include "content/public/renderer/render_view_observer.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityNotification.h"
@@ -32,7 +33,8 @@ struct WebAccessibility;
// nodes in the tree (e.g., change focus, or click on a button).
class RendererAccessibility : public content::RenderViewObserver {
public:
- RendererAccessibility(RenderViewImpl* render_view);
+ RendererAccessibility(RenderViewImpl* render_view,
+ AccessibilityMode accessibility_mode);
virtual ~RendererAccessibility();
// RenderView::Observer implementation.
@@ -85,7 +87,7 @@ class RendererAccessibility : public content::RenderViewObserver {
void OnChangeScrollPosition(int acc_obj_id, int scroll_x, int scroll_y);
void OnScrollToMakeVisible(int acc_obj_id, gfx::Rect subfocus);
void OnScrollToPoint(int acc_obj_id, gfx::Point point);
- void OnEnable();
+ void OnSetMode(AccessibilityMode mode);
void OnSetFocus(int acc_obj_id);
void OnSetTextSelection(int acc_obj_id, int start_offset, int end_offset);
@@ -98,6 +100,23 @@ class RendererAccessibility : public content::RenderViewObserver {
// no view or frame.
WebKit::WebDocument GetMainDocument();
+ // Checks if a WebKit accessibility object is an editable text node.
+ bool IsEditableText(const WebKit::WebAccessibilityObject& node);
+
+ // Recursively explore the tree of WebKit accessibility objects rooted
+ // at |src|, and for each editable text node encountered, add a
+ // corresponding WebAccessibility node as a child of |dst|.
+ void RecursiveAddEditableTextNodesToTree(
+ const WebKit::WebAccessibilityObject& src,
+ webkit_glue::WebAccessibility* dst);
+
+ // Build a tree of serializable WebAccessibility nodes to send to the
+ // browser process, given a WebAccessibilityObject node from WebKit.
+ // Modifies |dst| in-place, it's assumed to be empty.
+ void BuildAccessibilityTree(const WebKit::WebAccessibilityObject& src,
+ bool include_children,
+ webkit_glue::WebAccessibility* dst);
+
// So we can queue up tasks to be executed later.
base::WeakPtrFactory<RendererAccessibility> weak_factory_;
@@ -116,6 +135,9 @@ class RendererAccessibility : public content::RenderViewObserver {
// is fixed.
gfx::Size last_scroll_offset_;
+ // The current accessibility mode.
+ AccessibilityMode mode_;
+
// Set if we are waiting for an accessibility notification ack.
bool ack_pending_;

Powered by Google App Engine
This is Rietveld 408576698