| 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" |
| 11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 12 #include "base/metrics/user_metrics_action.h" | 12 #include "base/metrics/user_metrics_action.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "content/browser/accessibility/accessibility_mode_helper.h" | 14 #include "content/browser/accessibility/accessibility_mode_helper.h" |
| 15 #include "content/browser/accessibility/browser_accessibility_manager.h" | 15 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 16 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 16 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
| 17 #include "content/browser/child_process_security_policy_impl.h" | 17 #include "content/browser/child_process_security_policy_impl.h" |
| 18 #include "content/browser/frame_host/cross_process_frame_connector.h" | 18 #include "content/browser/frame_host/cross_process_frame_connector.h" |
| 19 #include "content/browser/frame_host/cross_site_transferring_request.h" | 19 #include "content/browser/frame_host/cross_site_transferring_request.h" |
| 20 #include "content/browser/frame_host/frame_accessibility.h" | 20 #include "content/browser/frame_host/frame_accessibility.h" |
| 21 #include "content/browser/frame_host/frame_tree.h" | 21 #include "content/browser/frame_host/frame_tree.h" |
| 22 #include "content/browser/frame_host/frame_tree_node.h" | 22 #include "content/browser/frame_host/frame_tree_node.h" |
| 23 #include "content/browser/frame_host/navigator.h" | 23 #include "content/browser/frame_host/navigator.h" |
| 24 #include "content/browser/frame_host/render_frame_host_delegate.h" | 24 #include "content/browser/frame_host/render_frame_host_delegate.h" |
| 25 #include "content/browser/frame_host/render_frame_proxy_host.h" | 25 #include "content/browser/frame_host/render_frame_proxy_host.h" |
| 26 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 26 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
| 27 #include "content/browser/geolocation/geolocation_service_context.h" | 27 #include "content/browser/geolocation/geolocation_service_context.h" |
| 28 #include "content/browser/permissions/permission_service_context.h" |
| 29 #include "content/browser/permissions/permission_service_impl.h" |
| 28 #include "content/browser/renderer_host/input/input_router.h" | 30 #include "content/browser/renderer_host/input/input_router.h" |
| 29 #include "content/browser/renderer_host/input/timeout_monitor.h" | 31 #include "content/browser/renderer_host/input/timeout_monitor.h" |
| 30 #include "content/browser/renderer_host/render_process_host_impl.h" | 32 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 31 #include "content/browser/renderer_host/render_view_host_delegate.h" | 33 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 32 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 34 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
| 33 #include "content/browser/renderer_host/render_view_host_impl.h" | 35 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 34 #include "content/browser/renderer_host/render_widget_host_impl.h" | 36 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 35 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 37 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 36 #include "content/browser/transition_request_manager.h" | 38 #include "content/browser/transition_request_manager.h" |
| 37 #include "content/common/accessibility_messages.h" | 39 #include "content/common/accessibility_messages.h" |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1241 if (geolocation_service_context) { | 1243 if (geolocation_service_context) { |
| 1242 // TODO(creis): Bind process ID here so that GeolocationServiceImpl | 1244 // TODO(creis): Bind process ID here so that GeolocationServiceImpl |
| 1243 // can perform permissions checks once site isolation is complete. | 1245 // can perform permissions checks once site isolation is complete. |
| 1244 // crbug.com/426384 | 1246 // crbug.com/426384 |
| 1245 GetServiceRegistry()->AddService<GeolocationService>( | 1247 GetServiceRegistry()->AddService<GeolocationService>( |
| 1246 base::Bind(&GeolocationServiceContext::CreateService, | 1248 base::Bind(&GeolocationServiceContext::CreateService, |
| 1247 base::Unretained(geolocation_service_context), | 1249 base::Unretained(geolocation_service_context), |
| 1248 base::Bind(&RenderFrameHostImpl::DidUseGeolocationPermission, | 1250 base::Bind(&RenderFrameHostImpl::DidUseGeolocationPermission, |
| 1249 base::Unretained(this)))); | 1251 base::Unretained(this)))); |
| 1250 } | 1252 } |
| 1253 |
| 1254 scoped_ptr<PermissionServiceContext> permission_service_context( |
| 1255 new PermissionServiceContext(this)); |
| 1256 GetServiceRegistry()->AddService( |
| 1257 base::Bind(&PermissionServiceImpl::Create, |
| 1258 base::Passed(&permission_service_context))); |
| 1251 } | 1259 } |
| 1252 | 1260 |
| 1253 void RenderFrameHostImpl::SetState(RenderFrameHostImplState rfh_state) { | 1261 void RenderFrameHostImpl::SetState(RenderFrameHostImplState rfh_state) { |
| 1254 // Only main frames should be swapped out and retained inside a proxy host. | 1262 // Only main frames should be swapped out and retained inside a proxy host. |
| 1255 if (rfh_state == STATE_SWAPPED_OUT) | 1263 if (rfh_state == STATE_SWAPPED_OUT) |
| 1256 CHECK(!GetParent()); | 1264 CHECK(!GetParent()); |
| 1257 | 1265 |
| 1258 // We update the number of RenderFrameHosts in a SiteInstance when the swapped | 1266 // We update the number of RenderFrameHosts in a SiteInstance when the swapped |
| 1259 // out status of a RenderFrameHost gets flipped to/from active. | 1267 // out status of a RenderFrameHost gets flipped to/from active. |
| 1260 if (!IsRFHStateActive(rfh_state_) && IsRFHStateActive(rfh_state)) | 1268 if (!IsRFHStateActive(rfh_state_) && IsRFHStateActive(rfh_state)) |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1674 void RenderFrameHostImpl::DidUseGeolocationPermission() { | 1682 void RenderFrameHostImpl::DidUseGeolocationPermission() { |
| 1675 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); | 1683 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); |
| 1676 GetContentClient()->browser()->RegisterPermissionUsage( | 1684 GetContentClient()->browser()->RegisterPermissionUsage( |
| 1677 PERMISSION_GEOLOCATION, | 1685 PERMISSION_GEOLOCATION, |
| 1678 delegate_->GetAsWebContents(), | 1686 delegate_->GetAsWebContents(), |
| 1679 GetLastCommittedURL().GetOrigin(), | 1687 GetLastCommittedURL().GetOrigin(), |
| 1680 top_frame->GetLastCommittedURL().GetOrigin()); | 1688 top_frame->GetLastCommittedURL().GetOrigin()); |
| 1681 } | 1689 } |
| 1682 | 1690 |
| 1683 } // namespace content | 1691 } // namespace content |
| OLD | NEW |