Chromium Code Reviews| Index: content/browser/frame_host/frame_tree_node.cc |
| diff --git a/content/browser/frame_host/frame_tree_node.cc b/content/browser/frame_host/frame_tree_node.cc |
| index 845aecea62afc5945311f283f029c8d8b6504682..55dace0a4def03be403631b8038ed88b44c8c306 100644 |
| --- a/content/browser/frame_host/frame_tree_node.cc |
| +++ b/content/browser/frame_host/frame_tree_node.cc |
| @@ -34,8 +34,7 @@ FrameTreeNode::FrameTreeNode(FrameTree* frame_tree, |
| manager_delegate), |
| frame_tree_node_id_(next_frame_tree_node_id_++), |
| parent_(NULL), |
| - replication_state_(name), |
| - is_loading_(false) { |
| + replication_state_(name) { |
| } |
| FrameTreeNode::~FrameTreeNode() { |
| @@ -115,4 +114,31 @@ bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const { |
| return false; |
| } |
| +bool FrameTreeNode::IsLoading() const { |
| + RenderFrameHostImpl* current_frame_host = |
| + render_manager_.current_frame_host(); |
| + RenderFrameHostImpl* pending_frame_host = |
| + render_manager_.pending_frame_host(); |
| + |
| + DCHECK(current_frame_host != nullptr); |
| + if (pending_frame_host != nullptr) |
| + return current_frame_host->is_loading() || pending_frame_host->is_loading(); |
| + else |
| + return current_frame_host->is_loading(); |
| +} |
| + |
| +double FrameTreeNode::GetLoadingProgress() const { |
| + RenderFrameHostImpl* current_frame_host = |
| + render_manager_.current_frame_host(); |
| + RenderFrameHostImpl* pending_frame_host = |
| + render_manager_.pending_frame_host(); |
| + |
| + DCHECK(current_frame_host != nullptr); |
| + if (pending_frame_host != nullptr) |
| + return (current_frame_host->loading_progress() + |
| + pending_frame_host->loading_progress()) / 2; |
|
clamy
2015/02/24 13:54:55
Maybe use the max of the two rather than the avera
Charlie Reis
2015/02/25 00:07:21
I think we might be looking at this wrong. Do we
Fabrice (no longer in Chrome)
2015/02/26 13:44:12
This seems fairly reasonable. I am changing it to
|
| + else |
| + return current_frame_host->loading_progress(); |
| +} |
| + |
| } // namespace content |