| 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" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "content/browser/frame_host/frame_tree_node.h" | 12 #include "content/browser/frame_host/frame_tree_node.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 class FrameTreeNode; | 17 class FrameTreeNode; |
| 18 class Navigator; | 18 class Navigator; |
| 19 class RenderFrameHostDelegate; |
| 19 class RenderProcessHost; | 20 class RenderProcessHost; |
| 20 class RenderViewHostDelegate; | 21 class RenderViewHostDelegate; |
| 21 class RenderViewHostImpl; | 22 class RenderViewHostImpl; |
| 22 class RenderFrameHostManager; | 23 class RenderFrameHostManager; |
| 23 class RenderWidgetHostDelegate; | 24 class RenderWidgetHostDelegate; |
| 24 | 25 |
| 25 // Represents the frame tree for a page. With the exception of the main frame, | 26 // Represents the frame tree for a page. With the exception of the main frame, |
| 26 // all FrameTreeNodes will be created/deleted in response to frame attach and | 27 // all FrameTreeNodes will be created/deleted in response to frame attach and |
| 27 // detach events in the DOM. | 28 // detach events in the DOM. |
| 28 // | 29 // |
| (...skipping 10 matching lines...) Expand all Loading... |
| 39 // This object is only used on the UI thread. | 40 // This object is only used on the UI thread. |
| 40 class CONTENT_EXPORT FrameTree { | 41 class CONTENT_EXPORT FrameTree { |
| 41 public: | 42 public: |
| 42 // Each FrameTreeNode will default to using the given |navigator| for | 43 // Each FrameTreeNode will default to using the given |navigator| for |
| 43 // navigation tasks in the frame. | 44 // navigation tasks in the frame. |
| 44 // A set of delegates are remembered here so that we can create | 45 // A set of delegates are remembered here so that we can create |
| 45 // RenderFrameHostManagers. | 46 // RenderFrameHostManagers. |
| 46 // TODO(creis): This set of delegates will change as we move things to | 47 // TODO(creis): This set of delegates will change as we move things to |
| 47 // Navigator. | 48 // Navigator. |
| 48 FrameTree(Navigator* navigator, | 49 FrameTree(Navigator* navigator, |
| 50 RenderFrameHostDelegate* render_frame_delegate, |
| 49 RenderViewHostDelegate* render_view_delegate, | 51 RenderViewHostDelegate* render_view_delegate, |
| 50 RenderWidgetHostDelegate* render_widget_delegate, | 52 RenderWidgetHostDelegate* render_widget_delegate, |
| 51 RenderFrameHostManager::Delegate* manager_delegate); | 53 RenderFrameHostManager::Delegate* manager_delegate); |
| 52 ~FrameTree(); | 54 ~FrameTree(); |
| 53 | 55 |
| 54 // Returns the FrameTreeNode with the given |frame_tree_node_id|. | 56 // Returns the FrameTreeNode with the given |frame_tree_node_id|. |
| 55 FrameTreeNode* FindByID(int64 frame_tree_node_id); | 57 FrameTreeNode* FindByID(int64 frame_tree_node_id); |
| 56 | 58 |
| 57 // Executes |on_node| on each node in the frame tree. If |on_node| returns | 59 // Executes |on_node| on each node in the frame tree. If |on_node| returns |
| 58 // false, terminates the iteration immediately. Returning false is useful | 60 // false, terminates the iteration immediately. Returning false is useful |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 FrameTreeNode* FindByFrameID(int64 frame_id); | 113 FrameTreeNode* FindByFrameID(int64 frame_id); |
| 112 | 114 |
| 113 scoped_ptr<FrameTreeNode> CreateNode(int64 frame_id, | 115 scoped_ptr<FrameTreeNode> CreateNode(int64 frame_id, |
| 114 const std::string& frame_name, | 116 const std::string& frame_name, |
| 115 int render_frame_host_id, | 117 int render_frame_host_id, |
| 116 Navigator* navigator, | 118 Navigator* navigator, |
| 117 RenderProcessHost* render_process_host); | 119 RenderProcessHost* render_process_host); |
| 118 | 120 |
| 119 // These delegates are installed into all the RenderViewHosts and | 121 // These delegates are installed into all the RenderViewHosts and |
| 120 // RenderFrameHosts that we create. | 122 // RenderFrameHosts that we create. |
| 123 RenderFrameHostDelegate* render_frame_delegate_; |
| 121 RenderViewHostDelegate* render_view_delegate_; | 124 RenderViewHostDelegate* render_view_delegate_; |
| 122 RenderWidgetHostDelegate* render_widget_delegate_; | 125 RenderWidgetHostDelegate* render_widget_delegate_; |
| 123 RenderFrameHostManager::Delegate* manager_delegate_; | 126 RenderFrameHostManager::Delegate* manager_delegate_; |
| 124 | 127 |
| 125 scoped_ptr<FrameTreeNode> root_; | 128 scoped_ptr<FrameTreeNode> root_; |
| 126 | 129 |
| 127 base::Callback<void(RenderViewHostImpl*, int64)> on_frame_removed_; | 130 base::Callback<void(RenderViewHostImpl*, int64)> on_frame_removed_; |
| 128 | 131 |
| 129 DISALLOW_COPY_AND_ASSIGN(FrameTree); | 132 DISALLOW_COPY_AND_ASSIGN(FrameTree); |
| 130 }; | 133 }; |
| 131 | 134 |
| 132 } // namespace content | 135 } // namespace content |
| 133 | 136 |
| 134 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_ | 137 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_ |
| OLD | NEW |