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" |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartProvisionalLoadForFrame, | 290 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartProvisionalLoadForFrame, |
291 OnDidStartProvisionalLoadForFrame) | 291 OnDidStartProvisionalLoadForFrame) |
292 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailProvisionalLoadWithError, | 292 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailProvisionalLoadWithError, |
293 OnDidFailProvisionalLoadWithError) | 293 OnDidFailProvisionalLoadWithError) |
294 IPC_MESSAGE_HANDLER(FrameHostMsg_DidRedirectProvisionalLoad, | 294 IPC_MESSAGE_HANDLER(FrameHostMsg_DidRedirectProvisionalLoad, |
295 OnDidRedirectProvisionalLoad) | 295 OnDidRedirectProvisionalLoad) |
296 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailLoadWithError, | 296 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailLoadWithError, |
297 OnDidFailLoadWithError) | 297 OnDidFailLoadWithError) |
298 IPC_MESSAGE_HANDLER_GENERIC(FrameHostMsg_DidCommitProvisionalLoad, | 298 IPC_MESSAGE_HANDLER_GENERIC(FrameHostMsg_DidCommitProvisionalLoad, |
299 OnNavigate(msg)) | 299 OnNavigate(msg)) |
300 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartLoading, OnDidStartLoading) | |
301 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStopLoading, OnDidStopLoading) | |
302 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenURL, OnOpenURL) | 300 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenURL, OnOpenURL) |
303 IPC_MESSAGE_HANDLER(FrameHostMsg_DocumentOnLoadCompleted, | 301 IPC_MESSAGE_HANDLER(FrameHostMsg_DocumentOnLoadCompleted, |
304 OnDocumentOnLoadCompleted) | 302 OnDocumentOnLoadCompleted) |
305 IPC_MESSAGE_HANDLER(FrameHostMsg_BeforeUnload_ACK, OnBeforeUnloadACK) | 303 IPC_MESSAGE_HANDLER(FrameHostMsg_BeforeUnload_ACK, OnBeforeUnloadACK) |
306 IPC_MESSAGE_HANDLER(FrameHostMsg_SwapOut_ACK, OnSwapOutACK) | 304 IPC_MESSAGE_HANDLER(FrameHostMsg_SwapOut_ACK, OnSwapOutACK) |
307 IPC_MESSAGE_HANDLER(FrameHostMsg_ContextMenu, OnContextMenu) | 305 IPC_MESSAGE_HANDLER(FrameHostMsg_ContextMenu, OnContextMenu) |
308 IPC_MESSAGE_HANDLER(FrameHostMsg_JavaScriptExecuteResponse, | 306 IPC_MESSAGE_HANDLER(FrameHostMsg_JavaScriptExecuteResponse, |
309 OnJavaScriptExecuteResponse) | 307 OnJavaScriptExecuteResponse) |
310 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunJavaScriptMessage, | 308 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunJavaScriptMessage, |
311 OnRunJavaScriptMessage) | 309 OnRunJavaScriptMessage) |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 if (render_view_host_->IsRenderViewLive()) | 526 if (render_view_host_->IsRenderViewLive()) |
529 Send(new FrameMsg_SwapOut(routing_id_, proxy->GetRoutingID())); | 527 Send(new FrameMsg_SwapOut(routing_id_, proxy->GetRoutingID())); |
530 | 528 |
531 if (!GetParent()) | 529 if (!GetParent()) |
532 delegate_->SwappedOut(this); | 530 delegate_->SwappedOut(this); |
533 | 531 |
534 // Allow the navigation to proceed. | 532 // Allow the navigation to proceed. |
535 frame_tree_node_->render_manager()->SwappedOut(this); | 533 frame_tree_node_->render_manager()->SwappedOut(this); |
536 } | 534 } |
537 | 535 |
538 void RenderFrameHostImpl::OnDidStartLoading(bool to_different_document) { | |
539 delegate_->DidStartLoading(this, to_different_document); | |
540 } | |
541 | |
542 void RenderFrameHostImpl::OnDidStopLoading() { | |
543 delegate_->DidStopLoading(this); | |
544 } | |
545 | |
546 void RenderFrameHostImpl::OnBeforeUnloadACK( | 536 void RenderFrameHostImpl::OnBeforeUnloadACK( |
547 bool proceed, | 537 bool proceed, |
548 const base::TimeTicks& renderer_before_unload_start_time, | 538 const base::TimeTicks& renderer_before_unload_start_time, |
549 const base::TimeTicks& renderer_before_unload_end_time) { | 539 const base::TimeTicks& renderer_before_unload_end_time) { |
550 // TODO(creis): Support properly beforeunload on subframes. For now just | 540 // TODO(creis): Support properly beforeunload on subframes. For now just |
551 // pretend that the handler ran and allowed the navigation to proceed. | 541 // pretend that the handler ran and allowed the navigation to proceed. |
552 if (GetParent()) { | 542 if (GetParent()) { |
553 render_view_host_->is_waiting_for_beforeunload_ack_ = false; | 543 render_view_host_->is_waiting_for_beforeunload_ack_ = false; |
554 frame_tree_node_->render_manager()->OnBeforeUnloadACK( | 544 frame_tree_node_->render_manager()->OnBeforeUnloadACK( |
555 render_view_host_->unload_ack_is_for_cross_site_transition_, proceed, | 545 render_view_host_->unload_ack_is_for_cross_site_transition_, proceed, |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 cancel_notification_callbacks_.erase(notification_id); | 885 cancel_notification_callbacks_.erase(notification_id); |
896 } | 886 } |
897 | 887 |
898 void RenderFrameHostImpl::DesktopNotificationPermissionRequestDone( | 888 void RenderFrameHostImpl::DesktopNotificationPermissionRequestDone( |
899 int callback_context) { | 889 int callback_context) { |
900 Send(new DesktopNotificationMsg_PermissionRequestDone( | 890 Send(new DesktopNotificationMsg_PermissionRequestDone( |
901 routing_id_, callback_context)); | 891 routing_id_, callback_context)); |
902 } | 892 } |
903 | 893 |
904 } // namespace content | 894 } // namespace content |
OLD | NEW |