| 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 RenderViewImpl; | 14 class RenderViewImpl; |
| 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(RenderViewImpl* render_view); | 19 BlinkAXTreeSource(RenderViewImpl* render_view); |
| 20 virtual ~BlinkAXTreeSource(); | 20 virtual ~BlinkAXTreeSource(); |
| 21 | 21 |
| 22 // Call this to have BlinkAXTreeSource collect a mapping from |
| 23 // node ids to the guest instance id (for a <webview> plug-in) |
| 24 // or frame routing id (for an out-of-process iframe) during |
| 25 // calls to SerializeNode. |
| 26 void CollectChildFrameIdMapping( |
| 27 std::map<int32, int>* guest_instance_ids, |
| 28 std::map<int32, int>* frame_routing_ids); |
| 29 |
| 22 // AXTreeSource implementation. | 30 // AXTreeSource implementation. |
| 23 virtual blink::WebAXObject GetRoot() const OVERRIDE; | 31 virtual blink::WebAXObject GetRoot() const OVERRIDE; |
| 24 virtual blink::WebAXObject GetFromId(int32 id) const OVERRIDE; | 32 virtual blink::WebAXObject GetFromId(int32 id) const OVERRIDE; |
| 25 virtual int32 GetId(blink::WebAXObject node) const OVERRIDE; | 33 virtual int32 GetId(blink::WebAXObject node) const OVERRIDE; |
| 26 virtual void GetChildren( | 34 virtual void GetChildren( |
| 27 blink::WebAXObject node, | 35 blink::WebAXObject node, |
| 28 std::vector<blink::WebAXObject>* out_children) const OVERRIDE; | 36 std::vector<blink::WebAXObject>* out_children) const OVERRIDE; |
| 29 virtual blink::WebAXObject GetParent(blink::WebAXObject node) const | 37 virtual blink::WebAXObject GetParent(blink::WebAXObject node) const |
| 30 OVERRIDE; | 38 OVERRIDE; |
| 31 virtual void SerializeNode(blink::WebAXObject node, | 39 virtual void SerializeNode(blink::WebAXObject node, |
| 32 ui::AXNodeData* out_data) const OVERRIDE; | 40 ui::AXNodeData* out_data) const OVERRIDE; |
| 33 virtual bool IsValid(blink::WebAXObject node) const OVERRIDE; | 41 virtual bool IsValid(blink::WebAXObject node) const OVERRIDE; |
| 34 virtual bool IsEqual(blink::WebAXObject node1, | 42 virtual bool IsEqual(blink::WebAXObject node1, |
| 35 blink::WebAXObject node2) const OVERRIDE; | 43 blink::WebAXObject node2) const OVERRIDE; |
| 36 virtual blink::WebAXObject GetNull() const OVERRIDE; | 44 virtual blink::WebAXObject GetNull() const OVERRIDE; |
| 37 | 45 |
| 38 blink::WebDocument GetMainDocument() const; | 46 blink::WebDocument GetMainDocument() const; |
| 39 | 47 |
| 40 private: | 48 private: |
| 41 RenderViewImpl* render_view_; | 49 RenderViewImpl* render_view_; |
| 50 std::map<int32, int>* guest_instance_ids_; |
| 51 std::map<int32, int>* frame_routing_ids_; |
| 42 }; | 52 }; |
| 43 | 53 |
| 44 } // namespace content | 54 } // namespace content |
| 45 | 55 |
| 46 #endif // CONTENT_RENDERER_ACCESSIBILITY_BLINK_AX_TREE_SOURCE_H_ | 56 #endif // CONTENT_RENDERER_ACCESSIBILITY_BLINK_AX_TREE_SOURCE_H_ |
| OLD | NEW |