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 #include "content/browser/frame_host/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "content/browser/frame_host/frame_tree.h" | 8 #include "content/browser/frame_host/frame_tree.h" |
9 #include "content/browser/frame_host/frame_tree_node.h" | 9 #include "content/browser/frame_host/frame_tree_node.h" |
10 #include "content/browser/frame_host/load_progress_tracker.h" | |
10 #include "content/browser/frame_host/navigation_controller_impl.h" | 11 #include "content/browser/frame_host/navigation_controller_impl.h" |
11 #include "content/browser/frame_host/navigation_entry_impl.h" | 12 #include "content/browser/frame_host/navigation_entry_impl.h" |
12 #include "content/browser/frame_host/navigator_delegate.h" | 13 #include "content/browser/frame_host/navigator_delegate.h" |
13 #include "content/browser/frame_host/render_frame_host_impl.h" | 14 #include "content/browser/frame_host/render_frame_host_impl.h" |
14 #include "content/browser/renderer_host/render_view_host_impl.h" | 15 #include "content/browser/renderer_host/render_view_host_impl.h" |
15 #include "content/browser/site_instance_impl.h" | 16 #include "content/browser/site_instance_impl.h" |
16 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 17 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
17 #include "content/browser/webui/web_ui_impl.h" | 18 #include "content/browser/webui/web_ui_impl.h" |
18 #include "content/common/frame_messages.h" | 19 #include "content/common/frame_messages.h" |
19 #include "content/common/view_messages.h" | 20 #include "content/common/view_messages.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 return rfh->frame_tree_node()->frame_tree()->root()->render_manager(); | 128 return rfh->frame_tree_node()->frame_tree()->root()->render_manager(); |
128 } | 129 } |
129 | 130 |
130 } // namespace | 131 } // namespace |
131 | 132 |
132 | 133 |
133 NavigatorImpl::NavigatorImpl( | 134 NavigatorImpl::NavigatorImpl( |
134 NavigationControllerImpl* navigation_controller, | 135 NavigationControllerImpl* navigation_controller, |
135 NavigatorDelegate* delegate) | 136 NavigatorDelegate* delegate) |
136 : controller_(navigation_controller), | 137 : controller_(navigation_controller), |
137 delegate_(delegate) { | 138 delegate_(delegate), |
139 load_progress_tracker_(new LoadProgressTracker(delegate)) { | |
140 } | |
141 | |
142 NavigatorImpl::~NavigatorImpl() { | |
138 } | 143 } |
139 | 144 |
140 NavigationController* NavigatorImpl::GetController() { | 145 NavigationController* NavigatorImpl::GetController() { |
141 return controller_; | 146 return controller_; |
142 } | 147 } |
143 | 148 |
144 void NavigatorImpl::DidStartProvisionalLoad( | 149 void NavigatorImpl::DidStartProvisionalLoad( |
145 RenderFrameHostImpl* render_frame_host, | 150 RenderFrameHostImpl* render_frame_host, |
146 int parent_routing_id, | 151 int parent_routing_id, |
147 const GURL& url) { | 152 const GURL& url) { |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
384 | 389 |
385 bool NavigatorImpl::NavigateToPendingEntry( | 390 bool NavigatorImpl::NavigateToPendingEntry( |
386 RenderFrameHostImpl* render_frame_host, | 391 RenderFrameHostImpl* render_frame_host, |
387 NavigationController::ReloadType reload_type) { | 392 NavigationController::ReloadType reload_type) { |
388 return NavigateToEntry( | 393 return NavigateToEntry( |
389 render_frame_host, | 394 render_frame_host, |
390 *NavigationEntryImpl::FromNavigationEntry(controller_->GetPendingEntry()), | 395 *NavigationEntryImpl::FromNavigationEntry(controller_->GetPendingEntry()), |
391 reload_type); | 396 reload_type); |
392 } | 397 } |
393 | 398 |
399 void NavigatorImpl::DidStartLoading(RenderFrameHostImpl* render_frame_host, | |
400 bool to_different_document) { | |
401 if (delegate_) | |
402 delegate_->DidStartLoading(render_frame_host, to_different_document); | |
403 load_progress_tracker_->DidStartLoading(render_frame_host->GetRoutingID()); | |
404 } | |
405 | |
406 void NavigatorImpl::DidStopLoading(RenderFrameHostImpl* render_frame_host) { | |
407 if (delegate_) | |
nasko
2014/05/02 22:48:23
Don't we have to track that all frames are complet
Avi (use Gerrit)
2014/05/05 15:15:02
Let me think about this one for a while.
| |
408 delegate_->DidStopLoading(render_frame_host); | |
409 load_progress_tracker_->DidStopLoading(render_frame_host->GetRoutingID()); | |
410 } | |
411 | |
412 void NavigatorImpl::DidChangeLoadProgress( | |
413 RenderFrameHostImpl* render_frame_host, | |
414 double load_progress) { | |
415 load_progress_tracker_->DidChangeLoadProgress( | |
416 render_frame_host->GetRoutingID(), load_progress); | |
417 } | |
418 | |
394 base::TimeTicks NavigatorImpl::GetCurrentLoadStart() { | 419 base::TimeTicks NavigatorImpl::GetCurrentLoadStart() { |
395 return current_load_start_; | 420 return current_load_start_; |
396 } | 421 } |
397 | 422 |
398 void NavigatorImpl::DidNavigate( | 423 void NavigatorImpl::DidNavigate( |
399 RenderFrameHostImpl* render_frame_host, | 424 RenderFrameHostImpl* render_frame_host, |
400 const FrameHostMsg_DidCommitProvisionalLoad_Params& input_params) { | 425 const FrameHostMsg_DidCommitProvisionalLoad_Params& input_params) { |
401 FrameHostMsg_DidCommitProvisionalLoad_Params params(input_params); | 426 FrameHostMsg_DidCommitProvisionalLoad_Params params(input_params); |
402 FrameTree* frame_tree = render_frame_host->frame_tree_node()->frame_tree(); | 427 FrameTree* frame_tree = render_frame_host->frame_tree_node()->frame_tree(); |
403 bool use_site_per_process = | 428 bool use_site_per_process = |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
614 | 639 |
615 // Navigations in Web UI pages count as browser-initiated navigations. | 640 // Navigations in Web UI pages count as browser-initiated navigations. |
616 params.is_renderer_initiated = false; | 641 params.is_renderer_initiated = false; |
617 } | 642 } |
618 | 643 |
619 if (delegate_) | 644 if (delegate_) |
620 delegate_->RequestOpenURL(render_frame_host, params); | 645 delegate_->RequestOpenURL(render_frame_host, params); |
621 } | 646 } |
622 | 647 |
623 } // namespace content | 648 } // namespace content |
OLD | NEW |