OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 2728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2739 // future arrives, update this code to not allow this case. | 2739 // future arrives, update this code to not allow this case. |
2740 DCHECK_GE(loading_frames_in_progress_, 0); | 2740 DCHECK_GE(loading_frames_in_progress_, 0); |
2741 if (loading_progresses_.find(render_frame_id) == loading_progresses_.end()) { | 2741 if (loading_progresses_.find(render_frame_id) == loading_progresses_.end()) { |
2742 if (loading_frames_in_progress_ == 0) | 2742 if (loading_frames_in_progress_ == 0) |
2743 DidStartLoading(rfh, to_different_document); | 2743 DidStartLoading(rfh, to_different_document); |
2744 ++loading_frames_in_progress_; | 2744 ++loading_frames_in_progress_; |
2745 } | 2745 } |
2746 | 2746 |
2747 loading_progresses_[render_frame_id] = kMinimumLoadingProgress; | 2747 loading_progresses_[render_frame_id] = kMinimumLoadingProgress; |
2748 SendLoadProgressChanged(); | 2748 SendLoadProgressChanged(); |
2749 RecordAction(base::UserMetricsAction("FrameLoad")); | |
Charlie Reis
2014/10/31 16:55:45
DidStartLoading isn't the right place for this-- t
Lei Zhang
2014/11/01 00:51:47
FWIW, the PageLoad metric that's used as part of "
| |
2749 } | 2750 } |
2750 | 2751 |
2751 void WebContentsImpl::OnDidStopLoading() { | 2752 void WebContentsImpl::OnDidStopLoading() { |
2752 RenderFrameHostImpl* rfh = | 2753 RenderFrameHostImpl* rfh = |
2753 static_cast<RenderFrameHostImpl*>(render_frame_message_source_); | 2754 static_cast<RenderFrameHostImpl*>(render_frame_message_source_); |
2754 int64 render_frame_id = rfh->frame_tree_node()->frame_tree_node_id(); | 2755 int64 render_frame_id = rfh->frame_tree_node()->frame_tree_node_id(); |
2755 | 2756 |
2756 if (loading_progresses_.find(render_frame_id) != loading_progresses_.end()) { | 2757 if (loading_progresses_.find(render_frame_id) != loading_progresses_.end()) { |
2757 // Load stopped while we were still tracking load. Make sure we update | 2758 // Load stopped while we were still tracking load. Make sure we update |
2758 // progress based on this frame's completion. | 2759 // progress based on this frame's completion. |
(...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4331 node->render_manager()->ResumeResponseDeferredAtStart(); | 4332 node->render_manager()->ResumeResponseDeferredAtStart(); |
4332 } | 4333 } |
4333 | 4334 |
4334 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4335 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4335 force_disable_overscroll_content_ = force_disable; | 4336 force_disable_overscroll_content_ = force_disable; |
4336 if (view_) | 4337 if (view_) |
4337 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4338 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4338 } | 4339 } |
4339 | 4340 |
4340 } // namespace content | 4341 } // namespace content |
OLD | NEW |