Index: content/browser/frame_host/frame_tree.cc |
diff --git a/content/browser/frame_host/frame_tree.cc b/content/browser/frame_host/frame_tree.cc |
index 9977976aaba40eb87ec1c970367ba9b3f85a4053..1d23b3f4d74a3ea693fe97c51d514343f632b309 100644 |
--- a/content/browser/frame_host/frame_tree.cc |
+++ b/content/browser/frame_host/frame_tree.cc |
@@ -21,6 +21,7 @@ |
#include "content/browser/frame_host/render_frame_proxy_host.h" |
#include "content/browser/renderer_host/render_view_host_factory.h" |
#include "content/browser/renderer_host/render_view_host_impl.h" |
+#include "content/common/content_switches_internal.h" |
#include "content/common/input_messages.h" |
#include "content/common/site_isolation_policy.h" |
#include "third_party/WebKit/public/web/WebSandboxFlags.h" |
@@ -368,23 +369,26 @@ void FrameTree::FrameRemoved(FrameTreeNode* frame) { |
on_frame_removed_.Run(frame->current_frame_host()); |
} |
-void FrameTree::UpdateLoadProgress() { |
+void FrameTree::UpdateLoadProgress(FrameTreeNode* frame) { |
double progress = 0.0; |
- int frame_count = 0; |
- |
- for (FrameTreeNode* node : Nodes()) { |
- // Ignore the current frame if it has not started loading. |
- if (!node->has_started_loading()) |
- continue; |
- |
- // Collect progress. |
- progress += node->loading_progress(); |
- frame_count++; |
+ if (GetProgressBarCompletionOptions() == |
+ PROGRESS_BAR_COMPLETION_LOAD_EVENT) { |
+ int frame_count = 0; |
+ for (FrameTreeNode* node : Nodes()) { |
+ // Ignore the current frame if it has not started loading. |
+ if (!node->has_started_loading()) |
+ continue; |
+ |
+ // Collect progress. |
+ progress += node->loading_progress(); |
+ frame_count++; |
+ } |
+ if (frame_count != 0) |
+ progress /= frame_count; |
+ } else if (root_ == frame && root_->has_started_loading()) { |
dcheng
2016/05/10 06:28:50
Maybe just use frame->IsMainFrame()?
Nate Chapin
2016/05/11 00:06:58
Done.
|
+ progress = frame->loading_progress(); |
} |
- if (frame_count != 0) |
- progress /= frame_count; |
- |
if (progress <= load_progress_) |
return; |
load_progress_ = progress; |