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_BROWSER_FRAME_HOST_FRAME_ACCESSIBILITY_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_ACCESSIBILITY_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_ACCESSIBILITY_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_ACCESSIBILITY_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 30 matching lines...) Expand all Loading... | |
41 void OnRenderFrameHostDestroyed(RenderFrameHostImpl* render_frame_host); | 41 void OnRenderFrameHostDestroyed(RenderFrameHostImpl* render_frame_host); |
42 | 42 |
43 // Given a parent RenderFrameHostImpl and an accessibility node id, look up | 43 // Given a parent RenderFrameHostImpl and an accessibility node id, look up |
44 // a child frame or guest frame that was previously associated with this | 44 // a child frame or guest frame that was previously associated with this |
45 // frame and node id. If a mapping exists, return the resulting frame if | 45 // frame and node id. If a mapping exists, return the resulting frame if |
46 // it's valid. If it doesn't resolve to a valid RenderFrameHostImpl, | 46 // it's valid. If it doesn't resolve to a valid RenderFrameHostImpl, |
47 // returns NULL. | 47 // returns NULL. |
48 RenderFrameHostImpl* GetChild(RenderFrameHostImpl* parent_frame_host, | 48 RenderFrameHostImpl* GetChild(RenderFrameHostImpl* parent_frame_host, |
49 int accessibility_node_id); | 49 int accessibility_node_id); |
50 | 50 |
51 // Given a parent RenderFrameHostImpl and an accessibility node id, look up | |
52 // all child frames or guest frames that was previously associated with this | |
nasko
2015/01/15 21:44:38
nit: s/was/were/
dmazzoni
2015/01/15 23:09:22
Done.
| |
53 // frame, and populate |child_frame_hosts| with all of them that resolve | |
54 // to a valid RenderFrameHostImpl. | |
55 void GetAllChildFrames(RenderFrameHostImpl* parent_frame_host, | |
56 std::vector<RenderFrameHostImpl*>* child_frame_hosts); | |
57 | |
51 // Given a RenderFrameHostImpl, check the mapping table to see if it's | 58 // Given a RenderFrameHostImpl, check the mapping table to see if it's |
52 // the child of a node in some other frame. If so, return true and | 59 // the child of a node in some other frame. If so, return true and |
53 // set the parent frame and accessibility node id in the parent frame, | 60 // set the parent frame and accessibility node id in the parent frame, |
54 // otherwise return false. | 61 // otherwise return false. |
55 bool GetParent(RenderFrameHostImpl* child_frame_host, | 62 bool GetParent(RenderFrameHostImpl* child_frame_host, |
56 RenderFrameHostImpl** out_parent_frame_host, | 63 RenderFrameHostImpl** out_parent_frame_host, |
57 int* out_accessibility_node_id); | 64 int* out_accessibility_node_id); |
58 | 65 |
59 private: | 66 private: |
60 FrameAccessibility(); | 67 FrameAccessibility(); |
61 virtual ~FrameAccessibility(); | 68 virtual ~FrameAccessibility(); |
62 | 69 |
70 RenderFrameHostImpl* GetRFHIFromFrameTreeNodeId( | |
71 RenderFrameHostImpl* parent_frame_host, | |
72 int64 child_frame_tree_node_id); | |
73 | |
63 struct ChildFrameMapping { | 74 struct ChildFrameMapping { |
nasko
2015/01/15 21:44:38
I know this isn't part of this CL, but this struct
dmazzoni
2015/01/15 23:09:22
It's a bit odd but I think it's right - I added so
nasko
2015/01/16 00:20:33
Thanks! It is a lot better. I'm curious why this i
| |
64 ChildFrameMapping(); | 75 ChildFrameMapping(); |
65 | 76 |
66 RenderFrameHostImpl* parent_frame_host; | 77 RenderFrameHostImpl* parent_frame_host; |
67 int accessibility_node_id; | 78 int accessibility_node_id; |
68 int64 child_frame_tree_node_id; | 79 int64 child_frame_tree_node_id; |
69 int browser_plugin_instance_id; | 80 int browser_plugin_instance_id; |
70 }; | 81 }; |
71 | 82 |
72 std::vector<ChildFrameMapping> mappings_; | 83 std::vector<ChildFrameMapping> mappings_; |
73 | 84 |
74 friend struct DefaultSingletonTraits<FrameAccessibility>; | 85 friend struct DefaultSingletonTraits<FrameAccessibility>; |
75 }; | 86 }; |
76 | 87 |
77 } // namespace content | 88 } // namespace content |
78 | 89 |
79 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_ACCESSIBILITY_H_ | 90 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_ACCESSIBILITY_H_ |
OLD | NEW |