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 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
908 | 908 |
909 // TODO(jochen): Consider removing message handlers that only add a this | 909 // TODO(jochen): Consider removing message handlers that only add a this |
910 // pointer and forward the messages to the RenderViewHostDelegate. The | 910 // pointer and forward the messages to the RenderViewHostDelegate. The |
911 // respective delegates can handle the messages themselves in their | 911 // respective delegates can handle the messages themselves in their |
912 // OnMessageReceived implementation. | 912 // OnMessageReceived implementation. |
913 bool handled = true; | 913 bool handled = true; |
914 bool msg_is_ok = true; | 914 bool msg_is_ok = true; |
915 IPC_BEGIN_MESSAGE_MAP_EX(RenderViewHostImpl, msg, msg_is_ok) | 915 IPC_BEGIN_MESSAGE_MAP_EX(RenderViewHostImpl, msg, msg_is_ok) |
916 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowView, OnShowView) | 916 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowView, OnShowView) |
917 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowWidget, OnShowWidget) | 917 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowWidget, OnShowWidget) |
918 IPC_MESSAGE_HANDLER(ViewHostMsg_DidProgrammaticallyScroll, | |
919 OnDidProgrammaticallyScroll) | |
918 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowFullscreenWidget, | 920 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowFullscreenWidget, |
919 OnShowFullscreenWidget) | 921 OnShowFullscreenWidget) |
920 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunModal, OnRunModal) | 922 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunModal, OnRunModal) |
921 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady) | 923 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady) |
922 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewGone, OnRenderViewGone) | 924 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewGone, OnRenderViewGone) |
923 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStartProvisionalLoadForFrame, | 925 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStartProvisionalLoadForFrame, |
924 OnDidStartProvisionalLoadForFrame) | 926 OnDidStartProvisionalLoadForFrame) |
925 IPC_MESSAGE_HANDLER(ViewHostMsg_DidRedirectProvisionalLoad, | 927 IPC_MESSAGE_HANDLER(ViewHostMsg_DidRedirectProvisionalLoad, |
926 OnDidRedirectProvisionalLoad) | 928 OnDidRedirectProvisionalLoad) |
927 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFailProvisionalLoadWithError, | 929 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFailProvisionalLoadWithError, |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1068 Send(new ViewMsg_Move_ACK(route_id)); | 1070 Send(new ViewMsg_Move_ACK(route_id)); |
1069 } | 1071 } |
1070 | 1072 |
1071 void RenderViewHostImpl::OnShowWidget(int route_id, | 1073 void RenderViewHostImpl::OnShowWidget(int route_id, |
1072 const gfx::Rect& initial_pos) { | 1074 const gfx::Rect& initial_pos) { |
1073 if (!is_swapped_out_) | 1075 if (!is_swapped_out_) |
1074 delegate_->ShowCreatedWidget(route_id, initial_pos); | 1076 delegate_->ShowCreatedWidget(route_id, initial_pos); |
1075 Send(new ViewMsg_Move_ACK(route_id)); | 1077 Send(new ViewMsg_Move_ACK(route_id)); |
1076 } | 1078 } |
1077 | 1079 |
1080 void RenderViewHostImpl::OnDidProgrammaticallyScroll( | |
1081 const gfx::Point& scroll_point) { | |
1082 delegate_->DidProgrammaticallyScroll(scroll_point); | |
jam
2013/04/17 16:24:59
do not dispatch a message in RVHImpl just to call
Michael van Ouwerkerk
2013/04/18 18:11:38
Oh nice! Done.
| |
1083 } | |
1084 | |
1078 void RenderViewHostImpl::OnShowFullscreenWidget(int route_id) { | 1085 void RenderViewHostImpl::OnShowFullscreenWidget(int route_id) { |
1079 if (!is_swapped_out_) | 1086 if (!is_swapped_out_) |
1080 delegate_->ShowCreatedFullscreenWidget(route_id); | 1087 delegate_->ShowCreatedFullscreenWidget(route_id); |
1081 Send(new ViewMsg_Move_ACK(route_id)); | 1088 Send(new ViewMsg_Move_ACK(route_id)); |
1082 } | 1089 } |
1083 | 1090 |
1084 void RenderViewHostImpl::OnRunModal(int opener_id, IPC::Message* reply_msg) { | 1091 void RenderViewHostImpl::OnRunModal(int opener_id, IPC::Message* reply_msg) { |
1085 DCHECK(!run_modal_reply_msg_); | 1092 DCHECK(!run_modal_reply_msg_); |
1086 run_modal_reply_msg_ = reply_msg; | 1093 run_modal_reply_msg_ = reply_msg; |
1087 run_modal_opener_id_ = opener_id; | 1094 run_modal_opener_id_ = opener_id; |
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2062 is_waiting_for_beforeunload_ack_ = false; | 2069 is_waiting_for_beforeunload_ack_ = false; |
2063 is_waiting_for_unload_ack_ = false; | 2070 is_waiting_for_unload_ack_ = false; |
2064 has_timed_out_on_unload_ = false; | 2071 has_timed_out_on_unload_ = false; |
2065 } | 2072 } |
2066 | 2073 |
2067 void RenderViewHostImpl::ClearPowerSaveBlockers() { | 2074 void RenderViewHostImpl::ClearPowerSaveBlockers() { |
2068 STLDeleteValues(&power_save_blockers_); | 2075 STLDeleteValues(&power_save_blockers_); |
2069 } | 2076 } |
2070 | 2077 |
2071 } // namespace content | 2078 } // namespace content |
OLD | NEW |