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 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 | 910 |
911 // TODO(jochen): Consider removing message handlers that only add a this | 911 // TODO(jochen): Consider removing message handlers that only add a this |
912 // pointer and forward the messages to the RenderViewHostDelegate. The | 912 // pointer and forward the messages to the RenderViewHostDelegate. The |
913 // respective delegates can handle the messages themselves in their | 913 // respective delegates can handle the messages themselves in their |
914 // OnMessageReceived implementation. | 914 // OnMessageReceived implementation. |
915 bool handled = true; | 915 bool handled = true; |
916 bool msg_is_ok = true; | 916 bool msg_is_ok = true; |
917 IPC_BEGIN_MESSAGE_MAP_EX(RenderViewHostImpl, msg, msg_is_ok) | 917 IPC_BEGIN_MESSAGE_MAP_EX(RenderViewHostImpl, msg, msg_is_ok) |
918 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowView, OnShowView) | 918 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowView, OnShowView) |
919 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowWidget, OnShowWidget) | 919 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowWidget, OnShowWidget) |
| 920 IPC_MESSAGE_HANDLER(ViewHostMsg_DidProgrammaticallyScroll, |
| 921 OnDidProgrammaticallyScroll) |
920 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowFullscreenWidget, | 922 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowFullscreenWidget, |
921 OnShowFullscreenWidget) | 923 OnShowFullscreenWidget) |
922 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunModal, OnRunModal) | 924 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunModal, OnRunModal) |
923 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady) | 925 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady) |
924 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewGone, OnRenderViewGone) | 926 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewGone, OnRenderViewGone) |
925 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStartProvisionalLoadForFrame, | 927 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStartProvisionalLoadForFrame, |
926 OnDidStartProvisionalLoadForFrame) | 928 OnDidStartProvisionalLoadForFrame) |
927 IPC_MESSAGE_HANDLER(ViewHostMsg_DidRedirectProvisionalLoad, | 929 IPC_MESSAGE_HANDLER(ViewHostMsg_DidRedirectProvisionalLoad, |
928 OnDidRedirectProvisionalLoad) | 930 OnDidRedirectProvisionalLoad) |
929 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFailProvisionalLoadWithError, | 931 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFailProvisionalLoadWithError, |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 Send(new ViewMsg_Move_ACK(route_id)); | 1072 Send(new ViewMsg_Move_ACK(route_id)); |
1071 } | 1073 } |
1072 | 1074 |
1073 void RenderViewHostImpl::OnShowWidget(int route_id, | 1075 void RenderViewHostImpl::OnShowWidget(int route_id, |
1074 const gfx::Rect& initial_pos) { | 1076 const gfx::Rect& initial_pos) { |
1075 if (!is_swapped_out_) | 1077 if (!is_swapped_out_) |
1076 delegate_->ShowCreatedWidget(route_id, initial_pos); | 1078 delegate_->ShowCreatedWidget(route_id, initial_pos); |
1077 Send(new ViewMsg_Move_ACK(route_id)); | 1079 Send(new ViewMsg_Move_ACK(route_id)); |
1078 } | 1080 } |
1079 | 1081 |
| 1082 void RenderViewHostImpl::OnDidProgrammaticallyScroll( |
| 1083 const gfx::Point& scroll_point) { |
| 1084 delegate_->DidProgrammaticallyScroll(scroll_point); |
| 1085 } |
| 1086 |
1080 void RenderViewHostImpl::OnShowFullscreenWidget(int route_id) { | 1087 void RenderViewHostImpl::OnShowFullscreenWidget(int route_id) { |
1081 if (!is_swapped_out_) | 1088 if (!is_swapped_out_) |
1082 delegate_->ShowCreatedFullscreenWidget(route_id); | 1089 delegate_->ShowCreatedFullscreenWidget(route_id); |
1083 Send(new ViewMsg_Move_ACK(route_id)); | 1090 Send(new ViewMsg_Move_ACK(route_id)); |
1084 } | 1091 } |
1085 | 1092 |
1086 void RenderViewHostImpl::OnRunModal(int opener_id, IPC::Message* reply_msg) { | 1093 void RenderViewHostImpl::OnRunModal(int opener_id, IPC::Message* reply_msg) { |
1087 DCHECK(!run_modal_reply_msg_); | 1094 DCHECK(!run_modal_reply_msg_); |
1088 run_modal_reply_msg_ = reply_msg; | 1095 run_modal_reply_msg_ = reply_msg; |
1089 run_modal_opener_id_ = opener_id; | 1096 run_modal_opener_id_ = opener_id; |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2051 GetRoutingID(), snapshot_id, snapshot_size, png)); | 2058 GetRoutingID(), snapshot_id, snapshot_size, png)); |
2052 return; | 2059 return; |
2053 } | 2060 } |
2054 } | 2061 } |
2055 | 2062 |
2056 Send(new ViewMsg_WindowSnapshotCompleted( | 2063 Send(new ViewMsg_WindowSnapshotCompleted( |
2057 GetRoutingID(), snapshot_id, gfx::Size(), png)); | 2064 GetRoutingID(), snapshot_id, gfx::Size(), png)); |
2058 } | 2065 } |
2059 | 2066 |
2060 } // namespace content | 2067 } // namespace content |
OLD | NEW |