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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // Returns the FrameTreeNode with the given |frame_tree_node_id|. | 53 // Returns the FrameTreeNode with the given |frame_tree_node_id|. |
54 static FrameTreeNode* GloballyFindByID(int64 frame_tree_node_id); | 54 static FrameTreeNode* GloballyFindByID(int64 frame_tree_node_id); |
55 | 55 |
56 FrameTreeNode* root() const { return root_.get(); } | 56 FrameTreeNode* root() const { return root_.get(); } |
57 | 57 |
58 // Returns the FrameTreeNode with the given |frame_tree_node_id| if it is part | 58 // Returns the FrameTreeNode with the given |frame_tree_node_id| if it is part |
59 // of this FrameTree. | 59 // of this FrameTree. |
60 FrameTreeNode* FindByID(int64 frame_tree_node_id); | 60 FrameTreeNode* FindByID(int64 frame_tree_node_id); |
61 | 61 |
62 // Returns the FrameTreeNode with the given renderer-specific |routing_id|. | 62 // Returns the FrameTreeNode with the given renderer-specific |routing_id|. |
63 FrameTreeNode* FindByRoutingID(int routing_id, int process_id); | 63 FrameTreeNode* FindByRoutingID(int process_id, int routing_id); |
64 | 64 |
65 // 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 |
66 // false, terminates the iteration immediately. Returning false is useful | 66 // false, terminates the iteration immediately. Returning false is useful |
67 // 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 |
68 // 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 |
69 // it safe to remove children during the callback. | 69 // it safe to remove children during the callback. |
70 void ForEach(const base::Callback<bool(FrameTreeNode*)>& on_node) const; | 70 void ForEach(const base::Callback<bool(FrameTreeNode*)>& on_node) const; |
71 | 71 |
72 // Frame tree manipulation routines. | 72 // Frame tree manipulation routines. |
73 RenderFrameHostImpl* AddFrame(FrameTreeNode* parent, | 73 RenderFrameHostImpl* AddFrame(FrameTreeNode* parent, |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 int64 focused_frame_tree_node_id_; | 163 int64 focused_frame_tree_node_id_; |
164 | 164 |
165 base::Callback<void(RenderFrameHost*)> on_frame_removed_; | 165 base::Callback<void(RenderFrameHost*)> on_frame_removed_; |
166 | 166 |
167 DISALLOW_COPY_AND_ASSIGN(FrameTree); | 167 DISALLOW_COPY_AND_ASSIGN(FrameTree); |
168 }; | 168 }; |
169 | 169 |
170 } // namespace content | 170 } // namespace content |
171 | 171 |
172 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_ | 172 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_ |
OLD | NEW |