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 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1216 void RenderFrameHostImpl::OnBeginNavigation( | 1217 void RenderFrameHostImpl::OnBeginNavigation( |
1217 const CommonNavigationParams& common_params, | 1218 const CommonNavigationParams& common_params, |
1218 const BeginNavigationParams& begin_params, | 1219 const BeginNavigationParams& begin_params, |
1219 scoped_refptr<ResourceRequestBody> body) { | 1220 scoped_refptr<ResourceRequestBody> body) { |
1220 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 1221 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
1221 switches::kEnableBrowserSideNavigation)); | 1222 switches::kEnableBrowserSideNavigation)); |
1222 frame_tree_node()->navigator()->OnBeginNavigation( | 1223 frame_tree_node()->navigator()->OnBeginNavigation( |
1223 frame_tree_node(), common_params, begin_params, body); | 1224 frame_tree_node(), common_params, begin_params, body); |
1224 } | 1225 } |
1225 | 1226 |
| 1227 void RenderFrameHostImpl::OnDispatchLoad() { |
| 1228 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1229 switches::kSitePerProcess)); |
| 1230 // Only frames with an out-of-process parent frame should be sending this |
| 1231 // message. |
| 1232 RenderFrameProxyHost* proxy = |
| 1233 frame_tree_node()->render_manager()->GetProxyToParent(); |
| 1234 if (!proxy) { |
| 1235 GetProcess()->ReceivedBadMessage(); |
| 1236 return; |
| 1237 } |
| 1238 |
| 1239 proxy->Send(new FrameMsg_DispatchLoad(proxy->GetRoutingID())); |
| 1240 } |
| 1241 |
1226 void RenderFrameHostImpl::OnAccessibilityEvents( | 1242 void RenderFrameHostImpl::OnAccessibilityEvents( |
1227 const std::vector<AccessibilityHostMsg_EventParams>& params, | 1243 const std::vector<AccessibilityHostMsg_EventParams>& params, |
1228 int reset_token) { | 1244 int reset_token) { |
1229 // Don't process this IPC if either we're waiting on a reset and this | 1245 // Don't process this IPC if either we're waiting on a reset and this |
1230 // IPC doesn't have the matching token ID, or if we're not waiting on a | 1246 // IPC doesn't have the matching token ID, or if we're not waiting on a |
1231 // reset but this message includes a reset token. | 1247 // reset but this message includes a reset token. |
1232 if (accessibility_reset_token_ != reset_token) { | 1248 if (accessibility_reset_token_ != reset_token) { |
1233 Send(new AccessibilityMsg_Events_ACK(routing_id_)); | 1249 Send(new AccessibilityMsg_Events_ACK(routing_id_)); |
1234 return; | 1250 return; |
1235 } | 1251 } |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1894 void RenderFrameHostImpl::DidUseGeolocationPermission() { | 1910 void RenderFrameHostImpl::DidUseGeolocationPermission() { |
1895 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); | 1911 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); |
1896 GetContentClient()->browser()->RegisterPermissionUsage( | 1912 GetContentClient()->browser()->RegisterPermissionUsage( |
1897 PERMISSION_GEOLOCATION, | 1913 PERMISSION_GEOLOCATION, |
1898 delegate_->GetAsWebContents(), | 1914 delegate_->GetAsWebContents(), |
1899 GetLastCommittedURL().GetOrigin(), | 1915 GetLastCommittedURL().GetOrigin(), |
1900 top_frame->GetLastCommittedURL().GetOrigin()); | 1916 top_frame->GetLastCommittedURL().GetOrigin()); |
1901 } | 1917 } |
1902 | 1918 |
1903 } // namespace content | 1919 } // namespace content |
OLD | NEW |