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