OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_TREE_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // RenderFrameHostManagers. | 43 // RenderFrameHostManagers. |
44 // TODO(creis): This set of delegates will change as we move things to | 44 // TODO(creis): This set of delegates will change as we move things to |
45 // Navigator. | 45 // Navigator. |
46 FrameTree(Navigator* navigator, | 46 FrameTree(Navigator* navigator, |
47 RenderFrameHostDelegate* render_frame_delegate, | 47 RenderFrameHostDelegate* render_frame_delegate, |
48 RenderViewHostDelegate* render_view_delegate, | 48 RenderViewHostDelegate* render_view_delegate, |
49 RenderWidgetHostDelegate* render_widget_delegate, | 49 RenderWidgetHostDelegate* render_widget_delegate, |
50 RenderFrameHostManager::Delegate* manager_delegate); | 50 RenderFrameHostManager::Delegate* manager_delegate); |
51 ~FrameTree(); | 51 ~FrameTree(); |
52 | 52 |
| 53 // Returns the FrameTreeNode with the given |frame_tree_node_id|. |
| 54 static FrameTreeNode* GloballyFindByID(int64 frame_tree_node_id); |
| 55 |
53 FrameTreeNode* root() const { return root_.get(); } | 56 FrameTreeNode* root() const { return root_.get(); } |
54 | 57 |
55 // Returns the FrameTreeNode with the given |frame_tree_node_id|. | 58 // Returns the FrameTreeNode with the given |frame_tree_node_id| if it is part |
| 59 // of this FrameTree. |
56 FrameTreeNode* FindByID(int64 frame_tree_node_id); | 60 FrameTreeNode* FindByID(int64 frame_tree_node_id); |
57 | 61 |
58 // Returns the FrameTreeNode with the given renderer-specific |routing_id|. | 62 // Returns the FrameTreeNode with the given renderer-specific |routing_id|. |
59 FrameTreeNode* FindByRoutingID(int routing_id, int process_id); | 63 FrameTreeNode* FindByRoutingID(int routing_id, int process_id); |
60 | 64 |
61 // Executes |on_node| on each node in the frame tree. If |on_node| returns | 65 // Executes |on_node| on each node in the frame tree. If |on_node| returns |
62 // false, terminates the iteration immediately. Returning false is useful | 66 // false, terminates the iteration immediately. Returning false is useful |
63 // if |on_node| is just doing a search over the tree. The iteration proceeds | 67 // if |on_node| is just doing a search over the tree. The iteration proceeds |
64 // top-down and visits a node before adding its children to the queue, making | 68 // top-down and visits a node before adding its children to the queue, making |
65 // it safe to remove children during the callback. | 69 // it safe to remove children during the callback. |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 int64 focused_frame_tree_node_id_; | 164 int64 focused_frame_tree_node_id_; |
161 | 165 |
162 base::Callback<void(RenderFrameHost*)> on_frame_removed_; | 166 base::Callback<void(RenderFrameHost*)> on_frame_removed_; |
163 | 167 |
164 DISALLOW_COPY_AND_ASSIGN(FrameTree); | 168 DISALLOW_COPY_AND_ASSIGN(FrameTree); |
165 }; | 169 }; |
166 | 170 |
167 } // namespace content | 171 } // namespace content |
168 | 172 |
169 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_ | 173 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_ |
OLD | NEW |