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

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: Invert check. 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 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange, 868 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange,
869 OnMsgDidContentsPreferredSizeChange) 869 OnMsgDidContentsPreferredSizeChange)
870 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeScrollbarsForMainFrame, 870 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeScrollbarsForMainFrame,
871 OnMsgDidChangeScrollbarsForMainFrame) 871 OnMsgDidChangeScrollbarsForMainFrame)
872 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeScrollOffsetPinningForMainFrame, 872 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeScrollOffsetPinningForMainFrame,
873 OnMsgDidChangeScrollOffsetPinningForMainFrame) 873 OnMsgDidChangeScrollOffsetPinningForMainFrame)
874 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeNumWheelEvents, 874 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeNumWheelEvents,
875 OnMsgDidChangeNumWheelEvents) 875 OnMsgDidChangeNumWheelEvents)
876 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteCloseEvent, 876 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteCloseEvent,
877 OnMsgRouteCloseEvent) 877 OnMsgRouteCloseEvent)
878 IPC_MESSAGE_HANDLER(ViewHostMsg_RouteMessageEvent, OnMsgRouteMessageEvent)
878 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage, 879 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage,
879 OnMsgRunJavaScriptMessage) 880 OnMsgRunJavaScriptMessage)
880 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm, 881 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm,
881 OnMsgRunBeforeUnloadConfirm) 882 OnMsgRunBeforeUnloadConfirm)
882 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnMsgStartDragging) 883 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnMsgStartDragging)
883 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) 884 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor)
884 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK) 885 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK)
885 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus) 886 IPC_MESSAGE_HANDLER(ViewHostMsg_TakeFocus, OnTakeFocus)
886 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) 887 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnFocusedNodeChanged)
887 IPC_MESSAGE_HANDLER(ViewHostMsg_AddMessageToConsole, OnAddMessageToConsole) 888 IPC_MESSAGE_HANDLER(ViewHostMsg_AddMessageToConsole, OnAddMessageToConsole)
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 const gfx::Rect& end_rect) { 1275 const gfx::Rect& end_rect) {
1275 if (view_) 1276 if (view_)
1276 view_->SelectionBoundsChanged(start_rect, end_rect); 1277 view_->SelectionBoundsChanged(start_rect, end_rect);
1277 } 1278 }
1278 1279
1279 void RenderViewHostImpl::OnMsgRouteCloseEvent() { 1280 void RenderViewHostImpl::OnMsgRouteCloseEvent() {
1280 // Have the delegate route this to the active RenderViewHost. 1281 // Have the delegate route this to the active RenderViewHost.
1281 delegate_->RouteCloseEvent(this); 1282 delegate_->RouteCloseEvent(this);
1282 } 1283 }
1283 1284
1285 void RenderViewHostImpl::OnMsgRouteMessageEvent(
1286 const ViewMsg_PostMessage_Params& params) {
1287 // Give to the delegate to route to the active RenderViewHost.
1288 delegate_->RouteMessageEvent(this, params);
1289 }
1290
1284 void RenderViewHostImpl::OnMsgRunJavaScriptMessage( 1291 void RenderViewHostImpl::OnMsgRunJavaScriptMessage(
1285 const string16& message, 1292 const string16& message,
1286 const string16& default_prompt, 1293 const string16& default_prompt,
1287 const GURL& frame_url, 1294 const GURL& frame_url,
1288 ui::JavascriptMessageType type, 1295 ui::JavascriptMessageType type,
1289 IPC::Message* reply_msg) { 1296 IPC::Message* reply_msg) {
1290 // While a JS message dialog is showing, tabs in the same process shouldn't 1297 // While a JS message dialog is showing, tabs in the same process shouldn't
1291 // process input events. 1298 // process input events.
1292 GetProcess()->SetIgnoreInputEvents(true); 1299 GetProcess()->SetIgnoreInputEvents(true);
1293 StopHangMonitorTimeout(); 1300 StopHangMonitorTimeout();
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
1821 // can cause navigations to be ignored in OnMsgNavigate. 1828 // can cause navigations to be ignored in OnMsgNavigate.
1822 is_waiting_for_beforeunload_ack_ = false; 1829 is_waiting_for_beforeunload_ack_ = false;
1823 is_waiting_for_unload_ack_ = false; 1830 is_waiting_for_unload_ack_ = false;
1824 } 1831 }
1825 1832
1826 void RenderViewHostImpl::ClearPowerSaveBlockers() { 1833 void RenderViewHostImpl::ClearPowerSaveBlockers() {
1827 STLDeleteValues(&power_save_blockers_); 1834 STLDeleteValues(&power_save_blockers_);
1828 } 1835 }
1829 1836
1830 } // namespace content 1837 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698