| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 RenderFrameHostImpl* current_frame_host() const { | 170 RenderFrameHostImpl* current_frame_host() const { |
| 171 return render_manager_.current_frame_host(); | 171 return render_manager_.current_frame_host(); |
| 172 } | 172 } |
| 173 | 173 |
| 174 bool IsDescendantOf(FrameTreeNode* other) const; | 174 bool IsDescendantOf(FrameTreeNode* other) const; |
| 175 | 175 |
| 176 // Return the node immediately preceding this node in its parent's | 176 // Return the node immediately preceding this node in its parent's |
| 177 // |children_|, or nullptr if there is no such node. | 177 // |children_|, or nullptr if there is no such node. |
| 178 FrameTreeNode* PreviousSibling() const; | 178 FrameTreeNode* PreviousSibling() const; |
| 179 | 179 |
| 180 // Return the node immediately after this node in its parent's |
| 181 // |children_|, or nullptr if there is no such node. |
| 182 FrameTreeNode* NextSibling() const; |
| 183 |
| 180 // Returns true if this node is in a loading state. | 184 // Returns true if this node is in a loading state. |
| 181 bool IsLoading() const; | 185 bool IsLoading() const; |
| 182 | 186 |
| 183 // Returns this node's loading progress. | 187 // Returns this node's loading progress. |
| 184 double loading_progress() const { return loading_progress_; } | 188 double loading_progress() const { return loading_progress_; } |
| 185 | 189 |
| 186 NavigationRequest* navigation_request() { return navigation_request_.get(); } | 190 NavigationRequest* navigation_request() { return navigation_request_.get(); } |
| 187 | 191 |
| 188 // PlzNavigate | 192 // PlzNavigate |
| 189 // Takes ownership of |navigation_request| and makes it the current | 193 // Takes ownership of |navigation_request| and makes it the current |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 // Returns the time this frame was last focused. | 230 // Returns the time this frame was last focused. |
| 227 base::TimeTicks last_focus_time() const { return last_focus_time_; } | 231 base::TimeTicks last_focus_time() const { return last_focus_time_; } |
| 228 | 232 |
| 229 // Called when this node becomes focused. Updates the node's last focused | 233 // Called when this node becomes focused. Updates the node's last focused |
| 230 // time and notifies observers. | 234 // time and notifies observers. |
| 231 void DidFocus(); | 235 void DidFocus(); |
| 232 | 236 |
| 233 private: | 237 private: |
| 234 class OpenerDestroyedObserver; | 238 class OpenerDestroyedObserver; |
| 235 | 239 |
| 240 FrameTreeNode* GetSibling(int relative_offset) const; |
| 241 |
| 236 void set_parent(FrameTreeNode* parent) { parent_ = parent; } | 242 void set_parent(FrameTreeNode* parent) { parent_ = parent; } |
| 237 | 243 |
| 238 // The next available browser-global FrameTreeNode ID. | 244 // The next available browser-global FrameTreeNode ID. |
| 239 static int next_frame_tree_node_id_; | 245 static int next_frame_tree_node_id_; |
| 240 | 246 |
| 241 // The FrameTree that owns us. | 247 // The FrameTree that owns us. |
| 242 FrameTree* frame_tree_; // not owned. | 248 FrameTree* frame_tree_; // not owned. |
| 243 | 249 |
| 244 // The Navigator object responsible for managing navigations at this node | 250 // The Navigator object responsible for managing navigations at this node |
| 245 // of the frame tree. | 251 // of the frame tree. |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 base::ObserverList<Observer> observers_; | 323 base::ObserverList<Observer> observers_; |
| 318 | 324 |
| 319 base::TimeTicks last_focus_time_; | 325 base::TimeTicks last_focus_time_; |
| 320 | 326 |
| 321 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); | 327 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); |
| 322 }; | 328 }; |
| 323 | 329 |
| 324 } // namespace content | 330 } // namespace content |
| 325 | 331 |
| 326 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ | 332 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ |
| OLD | NEW |