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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
867 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange, | 867 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange, |
868 OnMsgDidContentsPreferredSizeChange) | 868 OnMsgDidContentsPreferredSizeChange) |
869 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeScrollbarsForMainFrame, | 869 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeScrollbarsForMainFrame, |
870 OnMsgDidChangeScrollbarsForMainFrame) | 870 OnMsgDidChangeScrollbarsForMainFrame) |
871 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeScrollOffsetPinningForMainFrame, | 871 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeScrollOffsetPinningForMainFrame, |
872 OnMsgDidChangeScrollOffsetPinningForMainFrame) | 872 OnMsgDidChangeScrollOffsetPinningForMainFrame) |
873 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeNumWheelEvents, | 873 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeNumWheelEvents, |
874 OnMsgDidChangeNumWheelEvents) | 874 OnMsgDidChangeNumWheelEvents) |
875 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteCloseEvent, | 875 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteCloseEvent, |
876 OnMsgRouteCloseEvent) | 876 OnMsgRouteCloseEvent) |
877 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteMessageEvent, OnMsgRouteMessageEvent) | |
877 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage, | 878 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage, |
878 OnMsgRunJavaScriptMessage) | 879 OnMsgRunJavaScriptMessage) |
879 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm, | 880 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm, |
880 OnMsgRunBeforeUnloadConfirm) | 881 OnMsgRunBeforeUnloadConfirm) |
881 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnMsgStartDragging) | 882 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnMsgStartDragging) |
882 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) | 883 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) |
883 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK) | 884 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK) |
884 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) | 885 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) |
885 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) | 886 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) |
886 IPC_MESSAGE_HANDLER(ViewHostMsg_AddMessageToConsole, OnAddMessageToConsole) | 887 IPC_MESSAGE_HANDLER(ViewHostMsg_AddMessageToConsole, OnAddMessageToConsole) |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1256 const gfx::Rect& end_rect) { | 1257 const gfx::Rect& end_rect) { |
1257 if (view_) | 1258 if (view_) |
1258 view_->SelectionBoundsChanged(start_rect, end_rect); | 1259 view_->SelectionBoundsChanged(start_rect, end_rect); |
1259 } | 1260 } |
1260 | 1261 |
1261 void RenderViewHostImpl::OnMsgRouteCloseEvent() { | 1262 void RenderViewHostImpl::OnMsgRouteCloseEvent() { |
1262 // Have the delegate route this to the active RenderViewHost. | 1263 // Have the delegate route this to the active RenderViewHost. |
1263 delegate_->RouteCloseEvent(this); | 1264 delegate_->RouteCloseEvent(this); |
1264 } | 1265 } |
1265 | 1266 |
1267 void RenderViewHostImpl::OnMsgRouteMessageEvent( | |
1268 const ViewHostMsg_PostMessage_Params& params) { | |
1269 // Give to the delegate to route to the active RenderViewHost. | |
1270 delegate_->RouteMessageEvent(this, params); | |
jam
2012/05/14 06:41:45
a while back, I had gone through and removed all t
Charlie Reis
2012/05/14 17:38:43
It's unsafe to dispatch messages like this directl
| |
1271 } | |
1272 | |
1266 void RenderViewHostImpl::OnMsgRunJavaScriptMessage( | 1273 void RenderViewHostImpl::OnMsgRunJavaScriptMessage( |
1267 const string16& message, | 1274 const string16& message, |
1268 const string16& default_prompt, | 1275 const string16& default_prompt, |
1269 const GURL& frame_url, | 1276 const GURL& frame_url, |
1270 ui::JavascriptMessageType type, | 1277 ui::JavascriptMessageType type, |
1271 IPC::Message* reply_msg) { | 1278 IPC::Message* reply_msg) { |
1272 // While a JS message dialog is showing, tabs in the same process shouldn't | 1279 // While a JS message dialog is showing, tabs in the same process shouldn't |
1273 // process input events. | 1280 // process input events. |
1274 GetProcess()->SetIgnoreInputEvents(true); | 1281 GetProcess()->SetIgnoreInputEvents(true); |
1275 StopHangMonitorTimeout(); | 1282 StopHangMonitorTimeout(); |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1803 // can cause navigations to be ignored in OnMsgNavigate. | 1810 // can cause navigations to be ignored in OnMsgNavigate. |
1804 is_waiting_for_beforeunload_ack_ = false; | 1811 is_waiting_for_beforeunload_ack_ = false; |
1805 is_waiting_for_unload_ack_ = false; | 1812 is_waiting_for_unload_ack_ = false; |
1806 } | 1813 } |
1807 | 1814 |
1808 void RenderViewHostImpl::ClearPowerSaveBlockers() { | 1815 void RenderViewHostImpl::ClearPowerSaveBlockers() { |
1809 STLDeleteValues(&power_save_blockers_); | 1816 STLDeleteValues(&power_save_blockers_); |
1810 } | 1817 } |
1811 | 1818 |
1812 } // namespace content | 1819 } // namespace content |
OLD | NEW |