| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunBeforeUnloadConfirm, | 366 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunBeforeUnloadConfirm, |
| 367 OnRunBeforeUnloadConfirm) | 367 OnRunBeforeUnloadConfirm) |
| 368 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAccessInitialDocument, | 368 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAccessInitialDocument, |
| 369 OnDidAccessInitialDocument) | 369 OnDidAccessInitialDocument) |
| 370 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDisownOpener, OnDidDisownOpener) | 370 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDisownOpener, OnDidDisownOpener) |
| 371 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAssignPageId, OnDidAssignPageId) | 371 IPC_MESSAGE_HANDLER(FrameHostMsg_DidAssignPageId, OnDidAssignPageId) |
| 372 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateTitle, OnUpdateTitle) | 372 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateTitle, OnUpdateTitle) |
| 373 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding) | 373 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding) |
| 374 IPC_MESSAGE_HANDLER(FrameHostMsg_BeginNavigation, | 374 IPC_MESSAGE_HANDLER(FrameHostMsg_BeginNavigation, |
| 375 OnBeginNavigation) | 375 OnBeginNavigation) |
| 376 IPC_MESSAGE_HANDLER(FrameHostMsg_DispatchLoad, OnDispatchLoad) |
| 376 IPC_MESSAGE_HANDLER(FrameHostMsg_TextSurroundingSelectionResponse, | 377 IPC_MESSAGE_HANDLER(FrameHostMsg_TextSurroundingSelectionResponse, |
| 377 OnTextSurroundingSelectionResponse) | 378 OnTextSurroundingSelectionResponse) |
| 378 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents) | 379 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents) |
| 379 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_LocationChanges, | 380 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_LocationChanges, |
| 380 OnAccessibilityLocationChanges) | 381 OnAccessibilityLocationChanges) |
| 381 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_FindInPageResult, | 382 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_FindInPageResult, |
| 382 OnAccessibilityFindInPageResult) | 383 OnAccessibilityFindInPageResult) |
| 383 IPC_MESSAGE_HANDLER(FrameHostMsg_ToggleFullscreen, OnToggleFullscreen) | 384 IPC_MESSAGE_HANDLER(FrameHostMsg_ToggleFullscreen, OnToggleFullscreen) |
| 384 // The following message is synthetic and doesn't come from RenderFrame, but | 385 // The following message is synthetic and doesn't come from RenderFrame, but |
| 385 // from RenderProcessHost. | 386 // from RenderProcessHost. |
| (...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1208 void RenderFrameHostImpl::OnBeginNavigation( | 1209 void RenderFrameHostImpl::OnBeginNavigation( |
| 1209 const CommonNavigationParams& common_params, | 1210 const CommonNavigationParams& common_params, |
| 1210 const BeginNavigationParams& begin_params, | 1211 const BeginNavigationParams& begin_params, |
| 1211 scoped_refptr<ResourceRequestBody> body) { | 1212 scoped_refptr<ResourceRequestBody> body) { |
| 1212 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 1213 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1213 switches::kEnableBrowserSideNavigation)); | 1214 switches::kEnableBrowserSideNavigation)); |
| 1214 frame_tree_node()->navigator()->OnBeginNavigation( | 1215 frame_tree_node()->navigator()->OnBeginNavigation( |
| 1215 frame_tree_node(), common_params, begin_params, body); | 1216 frame_tree_node(), common_params, begin_params, body); |
| 1216 } | 1217 } |
| 1217 | 1218 |
| 1219 void RenderFrameHostImpl::OnDispatchLoad() { |
| 1220 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1221 switches::kSitePerProcess)); |
| 1222 // Only frames with an out-of-process parent frame should be sending this |
| 1223 // message. |
| 1224 FrameTreeNode* parent = frame_tree_node()->parent(); |
| 1225 if (!parent || |
| 1226 parent->current_frame_host()->GetSiteInstance() == GetSiteInstance()) { |
| 1227 GetProcess()->ReceivedBadMessage(); |
| 1228 return; |
| 1229 } |
| 1230 |
| 1231 RenderFrameHostImpl* parent_rfh = parent->current_frame_host(); |
| 1232 parent_rfh->Send( |
| 1233 new FrameMsg_DispatchLoad(parent_rfh->GetRoutingID(), routing_id_)); |
| 1234 } |
| 1235 |
| 1218 void RenderFrameHostImpl::OnAccessibilityEvents( | 1236 void RenderFrameHostImpl::OnAccessibilityEvents( |
| 1219 const std::vector<AccessibilityHostMsg_EventParams>& params, | 1237 const std::vector<AccessibilityHostMsg_EventParams>& params, |
| 1220 int reset_token) { | 1238 int reset_token) { |
| 1221 // Don't process this IPC if either we're waiting on a reset and this | 1239 // Don't process this IPC if either we're waiting on a reset and this |
| 1222 // IPC doesn't have the matching token ID, or if we're not waiting on a | 1240 // IPC doesn't have the matching token ID, or if we're not waiting on a |
| 1223 // reset but this message includes a reset token. | 1241 // reset but this message includes a reset token. |
| 1224 if (accessibility_reset_token_ != reset_token) { | 1242 if (accessibility_reset_token_ != reset_token) { |
| 1225 Send(new AccessibilityMsg_Events_ACK(routing_id_)); | 1243 Send(new AccessibilityMsg_Events_ACK(routing_id_)); |
| 1226 return; | 1244 return; |
| 1227 } | 1245 } |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1886 void RenderFrameHostImpl::DidUseGeolocationPermission() { | 1904 void RenderFrameHostImpl::DidUseGeolocationPermission() { |
| 1887 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); | 1905 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); |
| 1888 GetContentClient()->browser()->RegisterPermissionUsage( | 1906 GetContentClient()->browser()->RegisterPermissionUsage( |
| 1889 PERMISSION_GEOLOCATION, | 1907 PERMISSION_GEOLOCATION, |
| 1890 delegate_->GetAsWebContents(), | 1908 delegate_->GetAsWebContents(), |
| 1891 GetLastCommittedURL().GetOrigin(), | 1909 GetLastCommittedURL().GetOrigin(), |
| 1892 top_frame->GetLastCommittedURL().GetOrigin()); | 1910 top_frame->GetLastCommittedURL().GetOrigin()); |
| 1893 } | 1911 } |
| 1894 | 1912 |
| 1895 } // namespace content | 1913 } // namespace content |
| OLD | NEW |