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/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/metrics/user_metrics_action.h" | 10 #include "base/metrics/user_metrics_action.h" |
11 #include "content/browser/child_process_security_policy_impl.h" | 11 #include "content/browser/child_process_security_policy_impl.h" |
12 #include "content/browser/frame_host/cross_process_frame_connector.h" | 12 #include "content/browser/frame_host/cross_process_frame_connector.h" |
13 #include "content/browser/frame_host/cross_site_transferring_request.h" | 13 #include "content/browser/frame_host/cross_site_transferring_request.h" |
14 #include "content/browser/frame_host/frame_tree.h" | 14 #include "content/browser/frame_host/frame_tree.h" |
15 #include "content/browser/frame_host/frame_tree_node.h" | 15 #include "content/browser/frame_host/frame_tree_node.h" |
16 #include "content/browser/frame_host/navigator.h" | 16 #include "content/browser/frame_host/navigator.h" |
17 #include "content/browser/frame_host/render_frame_host_delegate.h" | 17 #include "content/browser/frame_host/render_frame_host_delegate.h" |
18 #include "content/browser/frame_host/render_frame_proxy_host.h" | 18 #include "content/browser/frame_host/render_frame_proxy_host.h" |
19 #include "content/browser/renderer_host/input/input_router.h" | 19 #include "content/browser/renderer_host/input/input_router.h" |
20 #include "content/browser/renderer_host/input/timeout_monitor.h" | 20 #include "content/browser/renderer_host/input/timeout_monitor.h" |
21 #include "content/browser/renderer_host/render_view_host_impl.h" | 21 #include "content/browser/renderer_host/render_view_host_impl.h" |
22 #include "content/browser/renderer_host/render_widget_host_impl.h" | 22 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 23 #include "content/browser/transition_request_manager.h" |
23 #include "content/common/desktop_notification_messages.h" | 24 #include "content/common/desktop_notification_messages.h" |
24 #include "content/common/frame_messages.h" | 25 #include "content/common/frame_messages.h" |
25 #include "content/common/input_messages.h" | 26 #include "content/common/input_messages.h" |
26 #include "content/common/inter_process_time_ticks_converter.h" | 27 #include "content/common/inter_process_time_ticks_converter.h" |
27 #include "content/common/swapped_out_messages.h" | 28 #include "content/common/swapped_out_messages.h" |
28 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
29 #include "content/public/browser/content_browser_client.h" | 30 #include "content/public/browser/content_browser_client.h" |
30 #include "content/public/browser/desktop_notification_delegate.h" | 31 #include "content/public/browser/desktop_notification_delegate.h" |
31 #include "content/public/browser/render_process_host.h" | 32 #include "content/public/browser/render_process_host.h" |
32 #include "content/public/browser/render_widget_host_view.h" | 33 #include "content/public/browser/render_widget_host_view.h" |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 const std::vector<GURL>& transfer_url_chain, | 508 const std::vector<GURL>& transfer_url_chain, |
508 const Referrer& referrer, | 509 const Referrer& referrer, |
509 PageTransition page_transition, | 510 PageTransition page_transition, |
510 bool should_replace_current_entry) { | 511 bool should_replace_current_entry) { |
511 frame_tree_node_->render_manager()->OnCrossSiteResponse( | 512 frame_tree_node_->render_manager()->OnCrossSiteResponse( |
512 this, global_request_id, cross_site_transferring_request.Pass(), | 513 this, global_request_id, cross_site_transferring_request.Pass(), |
513 transfer_url_chain, referrer, page_transition, | 514 transfer_url_chain, referrer, page_transition, |
514 should_replace_current_entry); | 515 should_replace_current_entry); |
515 } | 516 } |
516 | 517 |
| 518 void RenderFrameHostImpl::OnDeferredAfterResponseStarted( |
| 519 const GlobalRequestID& global_request_id) { |
| 520 frame_tree_node_->render_manager()->OnDeferredAfterResponseStarted( |
| 521 global_request_id, this); |
| 522 |
| 523 if (GetParent() || !delegate_->WillHandleDeferAfterResponseStarted()) |
| 524 frame_tree_node_->render_manager()->ResumeResponseDeferredAtStart(); |
| 525 else |
| 526 delegate_->DidDeferAfterResponseStarted(); |
| 527 } |
| 528 |
517 void RenderFrameHostImpl::SwapOut(RenderFrameProxyHost* proxy) { | 529 void RenderFrameHostImpl::SwapOut(RenderFrameProxyHost* proxy) { |
518 // TODO(creis): Move swapped out state to RFH. Until then, only update it | 530 // TODO(creis): Move swapped out state to RFH. Until then, only update it |
519 // when swapping out the main frame. | 531 // when swapping out the main frame. |
520 if (!GetParent()) { | 532 if (!GetParent()) { |
521 // If this RenderViewHost is not in the default state, it must have already | 533 // If this RenderViewHost is not in the default state, it must have already |
522 // gone through this, therefore just return. | 534 // gone through this, therefore just return. |
523 if (render_view_host_->rvh_state_ != RenderViewHostImpl::STATE_DEFAULT) | 535 if (render_view_host_->rvh_state_ != RenderViewHostImpl::STATE_DEFAULT) |
524 return; | 536 return; |
525 | 537 |
526 render_view_host_->SetState( | 538 render_view_host_->SetState( |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
901 void RenderFrameHostImpl::NotificationClosed(int notification_id) { | 913 void RenderFrameHostImpl::NotificationClosed(int notification_id) { |
902 cancel_notification_callbacks_.erase(notification_id); | 914 cancel_notification_callbacks_.erase(notification_id); |
903 } | 915 } |
904 | 916 |
905 void RenderFrameHostImpl::DesktopNotificationPermissionRequestDone( | 917 void RenderFrameHostImpl::DesktopNotificationPermissionRequestDone( |
906 int callback_context) { | 918 int callback_context) { |
907 Send(new DesktopNotificationMsg_PermissionRequestDone( | 919 Send(new DesktopNotificationMsg_PermissionRequestDone( |
908 routing_id_, callback_context)); | 920 routing_id_, callback_context)); |
909 } | 921 } |
910 | 922 |
| 923 void RenderFrameHostImpl::SetHasPendingTransitionRequest( |
| 924 bool has_pending_request) { |
| 925 BrowserThread::PostTask( |
| 926 BrowserThread::IO, |
| 927 FROM_HERE, |
| 928 base::Bind( |
| 929 &TransitionRequestManager::SetHasPendingTransitionRequest, |
| 930 base::Unretained(TransitionRequestManager::GetInstance()), |
| 931 GetProcess()->GetID(), |
| 932 routing_id_, |
| 933 has_pending_request)); |
| 934 } |
| 935 |
911 } // namespace content | 936 } // namespace content |
OLD | NEW |