Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 9108001: Adds support for calling postMessage on a frame living in a different renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor cleanup Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange, 938 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange,
939 OnMsgDidContentsPreferredSizeChange) 939 OnMsgDidContentsPreferredSizeChange)
940 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeScrollbarsForMainFrame, 940 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeScrollbarsForMainFrame,
941 OnMsgDidChangeScrollbarsForMainFrame) 941 OnMsgDidChangeScrollbarsForMainFrame)
942 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeScrollOffsetPinningForMainFrame, 942 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeScrollOffsetPinningForMainFrame,
943 OnMsgDidChangeScrollOffsetPinningForMainFrame) 943 OnMsgDidChangeScrollOffsetPinningForMainFrame)
944 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeNumWheelEvents, 944 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeNumWheelEvents,
945 OnMsgDidChangeNumWheelEvents) 945 OnMsgDidChangeNumWheelEvents)
946 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteCloseEvent, 946 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteCloseEvent,
947 OnMsgRouteCloseEvent) 947 OnMsgRouteCloseEvent)
948 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteMessageEvent, OnMsgRouteMessageEvent)
948 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage, 949 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage,
949 OnMsgRunJavaScriptMessage) 950 OnMsgRunJavaScriptMessage)
950 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm, 951 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm,
951 OnMsgRunBeforeUnloadConfirm) 952 OnMsgRunBeforeUnloadConfirm)
952 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnMsgStartDragging) 953 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnMsgStartDragging)
953 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) 954 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor)
954 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK) 955 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK)
955 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) 956 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus)
956 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) 957 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged)
957 IPC_MESSAGE_HANDLER(ViewHostMsg_AddMessageToConsole, OnAddMessageToConsole) 958 IPC_MESSAGE_HANDLER(ViewHostMsg_AddMessageToConsole, OnAddMessageToConsole)
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 const gfx::Rect& end_rect) { 1345 const gfx::Rect& end_rect) {
1345 if (view_) 1346 if (view_)
1346 view_->SelectionBoundsChanged(start_rect, end_rect); 1347 view_->SelectionBoundsChanged(start_rect, end_rect);
1347 } 1348 }
1348 1349
1349 void RenderViewHostImpl::OnMsgRouteCloseEvent() { 1350 void RenderViewHostImpl::OnMsgRouteCloseEvent() {
1350 // Have the delegate route this to the active RenderViewHost. 1351 // Have the delegate route this to the active RenderViewHost.
1351 delegate_->RouteCloseEvent(this); 1352 delegate_->RouteCloseEvent(this);
1352 } 1353 }
1353 1354
1355 void RenderViewHostImpl::OnMsgRouteMessageEvent(
1356 const ViewHostMsg_PostMessage_Params& params) {
1357 // Give to the delegate to route to the active RenderViewHost.
1358 delegate_->RouteMessageEvent(this, params);
1359 }
1360
1354 void RenderViewHostImpl::OnMsgRunJavaScriptMessage( 1361 void RenderViewHostImpl::OnMsgRunJavaScriptMessage(
1355 const string16& message, 1362 const string16& message,
1356 const string16& default_prompt, 1363 const string16& default_prompt,
1357 const GURL& frame_url, 1364 const GURL& frame_url,
1358 ui::JavascriptMessageType type, 1365 ui::JavascriptMessageType type,
1359 IPC::Message* reply_msg) { 1366 IPC::Message* reply_msg) {
1360 // While a JS message dialog is showing, tabs in the same process shouldn't 1367 // While a JS message dialog is showing, tabs in the same process shouldn't
1361 // process input events. 1368 // process input events.
1362 GetProcess()->SetIgnoreInputEvents(true); 1369 GetProcess()->SetIgnoreInputEvents(true);
1363 StopHangMonitorTimeout(); 1370 StopHangMonitorTimeout();
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
1894 is_waiting_for_beforeunload_ack_ = false; 1901 is_waiting_for_beforeunload_ack_ = false;
1895 is_waiting_for_unload_ack_ = false; 1902 is_waiting_for_unload_ack_ = false;
1896 has_timed_out_on_unload_ = false; 1903 has_timed_out_on_unload_ = false;
1897 } 1904 }
1898 1905
1899 void RenderViewHostImpl::ClearPowerSaveBlockers() { 1906 void RenderViewHostImpl::ClearPowerSaveBlockers() {
1900 STLDeleteValues(&power_save_blockers_); 1907 STLDeleteValues(&power_save_blockers_);
1901 } 1908 }
1902 1909
1903 } // namespace content 1910 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698