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

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: Scoped trace, clean up callbacks 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
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 void SetRoot(blink::WebAXObject root);
Charlie Reis 2015/04/10 20:18:07 Maybe add a comment saying why it's useful to over
dmazzoni 2015/04/10 21:57:12 Done.
23
22 // Call this to have BlinkAXTreeSource collect a mapping from 24 // Call this to have BlinkAXTreeSource collect a mapping from
23 // node ids to the frame routing id for an out-of-process iframe during 25 // node ids to the frame routing id for an out-of-process iframe during
24 // calls to SerializeNode. 26 // calls to SerializeNode.
25 void CollectChildFrameIdMapping( 27 void CollectChildFrameIdMapping(
26 std::map<int32, int>* node_to_frame_routing_id_map, 28 std::map<int32, int>* node_to_frame_routing_id_map,
27 std::map<int32, int>* node_to_browser_plugin_instance_id_map); 29 std::map<int32, int>* node_to_browser_plugin_instance_id_map);
28 30
29 // Walks up the ancestor chain to see if this is a descendant of the root. 31 // Walks up the ancestor chain to see if this is a descendant of the root.
30 bool IsInTree(blink::WebAXObject node) const; 32 bool IsInTree(blink::WebAXObject node) const;
31 33
(...skipping 15 matching lines...) Expand all
47 ui::AXNodeData* out_data) const override; 49 ui::AXNodeData* out_data) const override;
48 bool IsValid(blink::WebAXObject node) const override; 50 bool IsValid(blink::WebAXObject node) const override;
49 bool IsEqual(blink::WebAXObject node1, 51 bool IsEqual(blink::WebAXObject node1,
50 blink::WebAXObject node2) const override; 52 blink::WebAXObject node2) const override;
51 blink::WebAXObject GetNull() const override; 53 blink::WebAXObject GetNull() const override;
52 54
53 blink::WebDocument GetMainDocument() const; 55 blink::WebDocument GetMainDocument() const;
54 56
55 private: 57 private:
56 RenderFrameImpl* render_frame_; 58 RenderFrameImpl* render_frame_;
59 blink::WebAXObject root_;
57 std::map<int32, int>* node_to_frame_routing_id_map_; 60 std::map<int32, int>* node_to_frame_routing_id_map_;
58 std::map<int32, int>* node_to_browser_plugin_instance_id_map_; 61 std::map<int32, int>* node_to_browser_plugin_instance_id_map_;
59 int accessibility_focus_id_; 62 int accessibility_focus_id_;
60 }; 63 };
61 64
62 } // namespace content 65 } // namespace content
63 66
64 #endif // CONTENT_RENDERER_ACCESSIBILITY_BLINK_AX_TREE_SOURCE_H_ 67 #endif // CONTENT_RENDERER_ACCESSIBILITY_BLINK_AX_TREE_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698