| OLD | NEW |
| 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 virtual ~BlinkAXTreeSource(); | 20 ~BlinkAXTreeSource() override; |
| 21 | 21 |
| 22 // Call this to have BlinkAXTreeSource collect a mapping from | 22 // Call this to have BlinkAXTreeSource collect a mapping from |
| 23 // node ids to the frame routing id for an out-of-process iframe during | 23 // node ids to the frame routing id for an out-of-process iframe during |
| 24 // calls to SerializeNode. | 24 // calls to SerializeNode. |
| 25 void CollectChildFrameIdMapping( | 25 void CollectChildFrameIdMapping( |
| 26 std::map<int32, int>* node_to_frame_routing_id_map, | 26 std::map<int32, int>* node_to_frame_routing_id_map, |
| 27 std::map<int32, int>* node_to_browser_plugin_instance_id_map); | 27 std::map<int32, int>* node_to_browser_plugin_instance_id_map); |
| 28 | 28 |
| 29 // Walks up the ancestor chain to see if this is a descendant of the root. | 29 // Walks up the ancestor chain to see if this is a descendant of the root. |
| 30 bool IsInTree(blink::WebAXObject node) const; | 30 bool IsInTree(blink::WebAXObject node) const; |
| 31 | 31 |
| 32 // AXTreeSource implementation. | 32 // AXTreeSource implementation. |
| 33 virtual blink::WebAXObject GetRoot() const override; | 33 blink::WebAXObject GetRoot() const override; |
| 34 virtual blink::WebAXObject GetFromId(int32 id) const override; | 34 blink::WebAXObject GetFromId(int32 id) const override; |
| 35 virtual int32 GetId(blink::WebAXObject node) const override; | 35 int32 GetId(blink::WebAXObject node) const override; |
| 36 virtual void GetChildren( | 36 void GetChildren( |
| 37 blink::WebAXObject node, | 37 blink::WebAXObject node, |
| 38 std::vector<blink::WebAXObject>* out_children) const override; | 38 std::vector<blink::WebAXObject>* out_children) const override; |
| 39 virtual blink::WebAXObject GetParent(blink::WebAXObject node) const | 39 blink::WebAXObject GetParent(blink::WebAXObject node) const override; |
| 40 override; | 40 void SerializeNode(blink::WebAXObject node, |
| 41 virtual void SerializeNode(blink::WebAXObject node, | 41 ui::AXNodeData* out_data) const override; |
| 42 ui::AXNodeData* out_data) const override; | 42 bool IsValid(blink::WebAXObject node) const override; |
| 43 virtual bool IsValid(blink::WebAXObject node) const override; | 43 bool IsEqual(blink::WebAXObject node1, |
| 44 virtual bool IsEqual(blink::WebAXObject node1, | 44 blink::WebAXObject node2) const override; |
| 45 blink::WebAXObject node2) const override; | 45 blink::WebAXObject GetNull() const override; |
| 46 virtual blink::WebAXObject GetNull() const override; | |
| 47 | 46 |
| 48 blink::WebDocument GetMainDocument() const; | 47 blink::WebDocument GetMainDocument() const; |
| 49 | 48 |
| 50 private: | 49 private: |
| 51 RenderFrameImpl* render_frame_; | 50 RenderFrameImpl* render_frame_; |
| 52 std::map<int32, int>* node_to_frame_routing_id_map_; | 51 std::map<int32, int>* node_to_frame_routing_id_map_; |
| 53 std::map<int32, int>* node_to_browser_plugin_instance_id_map_; | 52 std::map<int32, int>* node_to_browser_plugin_instance_id_map_; |
| 54 }; | 53 }; |
| 55 | 54 |
| 56 } // namespace content | 55 } // namespace content |
| 57 | 56 |
| 58 #endif // CONTENT_RENDERER_ACCESSIBILITY_BLINK_AX_TREE_SOURCE_H_ | 57 #endif // CONTENT_RENDERER_ACCESSIBILITY_BLINK_AX_TREE_SOURCE_H_ |
| OLD | NEW |