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/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 | 911 |
912 // TODO(jochen): Consider removing message handlers that only add a this | 912 // TODO(jochen): Consider removing message handlers that only add a this |
913 // pointer and forward the messages to the RenderViewHostDelegate. The | 913 // pointer and forward the messages to the RenderViewHostDelegate. The |
914 // respective delegates can handle the messages themselves in their | 914 // respective delegates can handle the messages themselves in their |
915 // OnMessageReceived implementation. | 915 // OnMessageReceived implementation. |
916 bool handled = true; | 916 bool handled = true; |
917 bool msg_is_ok = true; | 917 bool msg_is_ok = true; |
918 IPC_BEGIN_MESSAGE_MAP_EX(RenderViewHostImpl, msg, msg_is_ok) | 918 IPC_BEGIN_MESSAGE_MAP_EX(RenderViewHostImpl, msg, msg_is_ok) |
919 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowView, OnShowView) | 919 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowView, OnShowView) |
920 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowWidget, OnShowWidget) | 920 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowWidget, OnShowWidget) |
| 921 IPC_MESSAGE_HANDLER(ViewHostMsg_DidProgrammaticallyScroll, |
| 922 OnDidProgrammaticallyScroll) |
921 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowFullscreenWidget, | 923 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowFullscreenWidget, |
922 OnShowFullscreenWidget) | 924 OnShowFullscreenWidget) |
923 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunModal, OnRunModal) | 925 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunModal, OnRunModal) |
924 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady) | 926 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady) |
925 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewGone, OnRenderViewGone) | 927 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewGone, OnRenderViewGone) |
926 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStartProvisionalLoadForFrame, | 928 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStartProvisionalLoadForFrame, |
927 OnDidStartProvisionalLoadForFrame) | 929 OnDidStartProvisionalLoadForFrame) |
928 IPC_MESSAGE_HANDLER(ViewHostMsg_DidRedirectProvisionalLoad, | 930 IPC_MESSAGE_HANDLER(ViewHostMsg_DidRedirectProvisionalLoad, |
929 OnDidRedirectProvisionalLoad) | 931 OnDidRedirectProvisionalLoad) |
930 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFailProvisionalLoadWithError, | 932 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFailProvisionalLoadWithError, |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 Send(new ViewMsg_Move_ACK(route_id)); | 1073 Send(new ViewMsg_Move_ACK(route_id)); |
1072 } | 1074 } |
1073 | 1075 |
1074 void RenderViewHostImpl::OnShowWidget(int route_id, | 1076 void RenderViewHostImpl::OnShowWidget(int route_id, |
1075 const gfx::Rect& initial_pos) { | 1077 const gfx::Rect& initial_pos) { |
1076 if (!is_swapped_out_) | 1078 if (!is_swapped_out_) |
1077 delegate_->ShowCreatedWidget(route_id, initial_pos); | 1079 delegate_->ShowCreatedWidget(route_id, initial_pos); |
1078 Send(new ViewMsg_Move_ACK(route_id)); | 1080 Send(new ViewMsg_Move_ACK(route_id)); |
1079 } | 1081 } |
1080 | 1082 |
| 1083 void RenderViewHostImpl::OnDidProgrammaticallyScroll( |
| 1084 const gfx::Point& scroll_point) { |
| 1085 delegate_->DidProgrammaticallyScroll(scroll_point); |
| 1086 } |
| 1087 |
1081 void RenderViewHostImpl::OnShowFullscreenWidget(int route_id) { | 1088 void RenderViewHostImpl::OnShowFullscreenWidget(int route_id) { |
1082 if (!is_swapped_out_) | 1089 if (!is_swapped_out_) |
1083 delegate_->ShowCreatedFullscreenWidget(route_id); | 1090 delegate_->ShowCreatedFullscreenWidget(route_id); |
1084 Send(new ViewMsg_Move_ACK(route_id)); | 1091 Send(new ViewMsg_Move_ACK(route_id)); |
1085 } | 1092 } |
1086 | 1093 |
1087 void RenderViewHostImpl::OnRunModal(int opener_id, IPC::Message* reply_msg) { | 1094 void RenderViewHostImpl::OnRunModal(int opener_id, IPC::Message* reply_msg) { |
1088 DCHECK(!run_modal_reply_msg_); | 1095 DCHECK(!run_modal_reply_msg_); |
1089 run_modal_reply_msg_ = reply_msg; | 1096 run_modal_reply_msg_ = reply_msg; |
1090 run_modal_opener_id_ = opener_id; | 1097 run_modal_opener_id_ = opener_id; |
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2065 is_waiting_for_beforeunload_ack_ = false; | 2072 is_waiting_for_beforeunload_ack_ = false; |
2066 is_waiting_for_unload_ack_ = false; | 2073 is_waiting_for_unload_ack_ = false; |
2067 has_timed_out_on_unload_ = false; | 2074 has_timed_out_on_unload_ = false; |
2068 } | 2075 } |
2069 | 2076 |
2070 void RenderViewHostImpl::ClearPowerSaveBlockers() { | 2077 void RenderViewHostImpl::ClearPowerSaveBlockers() { |
2071 STLDeleteValues(&power_save_blockers_); | 2078 STLDeleteValues(&power_save_blockers_); |
2072 } | 2079 } |
2073 | 2080 |
2074 } // namespace content | 2081 } // namespace content |
OLD | NEW |