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

Side by Side Diff: content/renderer/accessibility/blink_ax_tree_source.h

Issue 1051923003: Add a WebContentsImpl API to snapshot the accessibility tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up callbacks before end of OnRenderProcessGone Created 5 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 unified diff | Download patch
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/accessibility/blink_ax_tree_source.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_ACCESSIBILITY_BLINK_AX_TREE_SOURCE_H_ 5 #ifndef CONTENT_RENDERER_ACCESSIBILITY_BLINK_AX_TREE_SOURCE_H_
6 #define CONTENT_RENDERER_ACCESSIBILITY_BLINK_AX_TREE_SOURCE_H_ 6 #define CONTENT_RENDERER_ACCESSIBILITY_BLINK_AX_TREE_SOURCE_H_
7 7
8 #include "third_party/WebKit/public/web/WebAXObject.h" 8 #include "third_party/WebKit/public/web/WebAXObject.h"
9 #include "ui/accessibility/ax_node_data.h" 9 #include "ui/accessibility/ax_node_data.h"
10 #include "ui/accessibility/ax_tree_source.h" 10 #include "ui/accessibility/ax_tree_source.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 class RenderFrameImpl; 14 class RenderFrameImpl;
15 15
16 class BlinkAXTreeSource 16 class BlinkAXTreeSource
17 : public ui::AXTreeSource<blink::WebAXObject> { 17 : public ui::AXTreeSource<blink::WebAXObject> {
18 public: 18 public:
19 BlinkAXTreeSource(RenderFrameImpl* render_frame); 19 BlinkAXTreeSource(RenderFrameImpl* render_frame);
20 ~BlinkAXTreeSource() override; 20 ~BlinkAXTreeSource() override;
21 21
22 // It may be necessary to call SetRoot if you're using a WebScopedAXContext,
23 // because BlinkAXTreeSource can't get the root of the tree from the
24 // WebDocument if accessibility isn't enabled globally.
25 void SetRoot(blink::WebAXObject root);
26
22 // Call this to have BlinkAXTreeSource collect a mapping from 27 // Call this to have BlinkAXTreeSource collect a mapping from
23 // node ids to the frame routing id for an out-of-process iframe during 28 // node ids to the frame routing id for an out-of-process iframe during
24 // calls to SerializeNode. 29 // calls to SerializeNode.
25 void CollectChildFrameIdMapping( 30 void CollectChildFrameIdMapping(
26 std::map<int32, int>* node_to_frame_routing_id_map, 31 std::map<int32, int>* node_to_frame_routing_id_map,
27 std::map<int32, int>* node_to_browser_plugin_instance_id_map); 32 std::map<int32, int>* node_to_browser_plugin_instance_id_map);
28 33
29 // Walks up the ancestor chain to see if this is a descendant of the root. 34 // Walks up the ancestor chain to see if this is a descendant of the root.
30 bool IsInTree(blink::WebAXObject node) const; 35 bool IsInTree(blink::WebAXObject node) const;
31 36
(...skipping 15 matching lines...) Expand all
47 ui::AXNodeData* out_data) const override; 52 ui::AXNodeData* out_data) const override;
48 bool IsValid(blink::WebAXObject node) const override; 53 bool IsValid(blink::WebAXObject node) const override;
49 bool IsEqual(blink::WebAXObject node1, 54 bool IsEqual(blink::WebAXObject node1,
50 blink::WebAXObject node2) const override; 55 blink::WebAXObject node2) const override;
51 blink::WebAXObject GetNull() const override; 56 blink::WebAXObject GetNull() const override;
52 57
53 blink::WebDocument GetMainDocument() const; 58 blink::WebDocument GetMainDocument() const;
54 59
55 private: 60 private:
56 RenderFrameImpl* render_frame_; 61 RenderFrameImpl* render_frame_;
62 blink::WebAXObject root_;
57 std::map<int32, int>* node_to_frame_routing_id_map_; 63 std::map<int32, int>* node_to_frame_routing_id_map_;
58 std::map<int32, int>* node_to_browser_plugin_instance_id_map_; 64 std::map<int32, int>* node_to_browser_plugin_instance_id_map_;
59 int accessibility_focus_id_; 65 int accessibility_focus_id_;
60 }; 66 };
61 67
62 } // namespace content 68 } // namespace content
63 69
64 #endif // CONTENT_RENDERER_ACCESSIBILITY_BLINK_AX_TREE_SOURCE_H_ 70 #endif // CONTENT_RENDERER_ACCESSIBILITY_BLINK_AX_TREE_SOURCE_H_
OLDNEW
« no previous file with comments | « content/content_tests.gypi ('k') | content/renderer/accessibility/blink_ax_tree_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698