| 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_NODE_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 class FrameTree; | 26 class FrameTree; |
| 27 class NavigationRequest; | 27 class NavigationRequest; |
| 28 class Navigator; | 28 class Navigator; |
| 29 class RenderFrameHostImpl; | 29 class RenderFrameHostImpl; |
| 30 | 30 |
| 31 // When a page contains iframes, its renderer process maintains a tree structure | 31 // When a page contains iframes, its renderer process maintains a tree structure |
| 32 // of those frames. We are mirroring this tree in the browser process. This | 32 // of those frames. We are mirroring this tree in the browser process. This |
| 33 // class represents a node in this tree and is a wrapper for all objects that | 33 // class represents a node in this tree and is a wrapper for all objects that |
| 34 // are frame-specific (as opposed to page-specific). | 34 // are frame-specific (as opposed to page-specific). |
| 35 class CONTENT_EXPORT FrameTreeNode : | 35 class CONTENT_EXPORT FrameTreeNode { |
| 36 public base::trace_event::TraceLog::EnabledStateObserver { | |
| 37 public: | 36 public: |
| 38 class Observer { | 37 class Observer { |
| 39 public: | 38 public: |
| 40 // Invoked when a FrameTreeNode is being destroyed. | 39 // Invoked when a FrameTreeNode is being destroyed. |
| 41 virtual void OnFrameTreeNodeDestroyed(FrameTreeNode* node) {} | 40 virtual void OnFrameTreeNodeDestroyed(FrameTreeNode* node) {} |
| 42 | 41 |
| 43 // Invoked when a FrameTreeNode becomes focused. | 42 // Invoked when a FrameTreeNode becomes focused. |
| 44 virtual void OnFrameTreeNodeFocused(FrameTreeNode* node) {} | 43 virtual void OnFrameTreeNodeFocused(FrameTreeNode* node) {} |
| 45 | 44 |
| 46 virtual ~Observer() {} | 45 virtual ~Observer() {} |
| (...skipping 11 matching lines...) Expand all Loading... |
| 58 Navigator* navigator, | 57 Navigator* navigator, |
| 59 RenderFrameHostDelegate* render_frame_delegate, | 58 RenderFrameHostDelegate* render_frame_delegate, |
| 60 RenderViewHostDelegate* render_view_delegate, | 59 RenderViewHostDelegate* render_view_delegate, |
| 61 RenderWidgetHostDelegate* render_widget_delegate, | 60 RenderWidgetHostDelegate* render_widget_delegate, |
| 62 RenderFrameHostManager::Delegate* manager_delegate, | 61 RenderFrameHostManager::Delegate* manager_delegate, |
| 63 blink::WebTreeScopeType scope, | 62 blink::WebTreeScopeType scope, |
| 64 const std::string& name, | 63 const std::string& name, |
| 65 const std::string& unique_name, | 64 const std::string& unique_name, |
| 66 const blink::WebFrameOwnerProperties& frame_owner_properties); | 65 const blink::WebFrameOwnerProperties& frame_owner_properties); |
| 67 | 66 |
| 68 ~FrameTreeNode() override; | 67 ~FrameTreeNode(); |
| 69 | 68 |
| 70 void AddObserver(Observer* observer); | 69 void AddObserver(Observer* observer); |
| 71 void RemoveObserver(Observer* observer); | 70 void RemoveObserver(Observer* observer); |
| 72 | 71 |
| 73 bool IsMainFrame() const; | 72 bool IsMainFrame() const; |
| 74 | 73 |
| 75 FrameTreeNode* AddChild(scoped_ptr<FrameTreeNode> child, | 74 FrameTreeNode* AddChild(scoped_ptr<FrameTreeNode> child, |
| 76 int process_id, | 75 int process_id, |
| 77 int frame_routing_id); | 76 int frame_routing_id); |
| 78 void RemoveChild(FrameTreeNode* child); | 77 void RemoveChild(FrameTreeNode* child); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 260 |
| 262 // Called when this node becomes focused. Updates the node's last focused | 261 // Called when this node becomes focused. Updates the node's last focused |
| 263 // time and notifies observers. | 262 // time and notifies observers. |
| 264 void DidFocus(); | 263 void DidFocus(); |
| 265 | 264 |
| 266 // Called when the user closed the modal dialogue for BeforeUnload and | 265 // Called when the user closed the modal dialogue for BeforeUnload and |
| 267 // cancelled the navigation. This should stop any load happening in the | 266 // cancelled the navigation. This should stop any load happening in the |
| 268 // FrameTreeNode. | 267 // FrameTreeNode. |
| 269 void BeforeUnloadCanceled(); | 268 void BeforeUnloadCanceled(); |
| 270 | 269 |
| 271 // TraceLog::EnabledStateObserver | |
| 272 void OnTraceLogEnabled() override; | |
| 273 void OnTraceLogDisabled() override {} | |
| 274 | |
| 275 private: | 270 private: |
| 276 class OpenerDestroyedObserver; | 271 class OpenerDestroyedObserver; |
| 277 | 272 |
| 278 void set_parent(FrameTreeNode* parent) { parent_ = parent; } | 273 void set_parent(FrameTreeNode* parent) { parent_ = parent; } |
| 279 | 274 |
| 280 void TraceSnapshot() const; | |
| 281 | |
| 282 // The next available browser-global FrameTreeNode ID. | 275 // The next available browser-global FrameTreeNode ID. |
| 283 static int next_frame_tree_node_id_; | 276 static int next_frame_tree_node_id_; |
| 284 | 277 |
| 285 // The FrameTree that owns us. | 278 // The FrameTree that owns us. |
| 286 FrameTree* frame_tree_; // not owned. | 279 FrameTree* frame_tree_; // not owned. |
| 287 | 280 |
| 288 // The Navigator object responsible for managing navigations at this node | 281 // The Navigator object responsible for managing navigations at this node |
| 289 // of the frame tree. | 282 // of the frame tree. |
| 290 scoped_refptr<Navigator> navigator_; | 283 scoped_refptr<Navigator> navigator_; |
| 291 | 284 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 base::ObserverList<Observer> observers_; | 346 base::ObserverList<Observer> observers_; |
| 354 | 347 |
| 355 base::TimeTicks last_focus_time_; | 348 base::TimeTicks last_focus_time_; |
| 356 | 349 |
| 357 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); | 350 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); |
| 358 }; | 351 }; |
| 359 | 352 |
| 360 } // namespace content | 353 } // namespace content |
| 361 | 354 |
| 362 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ | 355 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ |
| OLD | NEW |