| 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 23 matching lines...) Expand all Loading... |
| 34 #include "content/browser/permissions/permission_service_impl.h" | 34 #include "content/browser/permissions/permission_service_impl.h" |
| 35 #include "content/browser/presentation/presentation_service_impl.h" | 35 #include "content/browser/presentation/presentation_service_impl.h" |
| 36 #include "content/browser/renderer_host/input/input_router.h" | 36 #include "content/browser/renderer_host/input/input_router.h" |
| 37 #include "content/browser/renderer_host/input/timeout_monitor.h" | 37 #include "content/browser/renderer_host/input/timeout_monitor.h" |
| 38 #include "content/browser/renderer_host/render_process_host_impl.h" | 38 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 39 #include "content/browser/renderer_host/render_view_host_delegate.h" | 39 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 40 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 40 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
| 41 #include "content/browser/renderer_host/render_view_host_impl.h" | 41 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 42 #include "content/browser/renderer_host/render_widget_host_impl.h" | 42 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 43 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 43 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 44 #include "content/browser/wake_lock/wake_lock_service_context.h" |
| 44 #include "content/common/accessibility_messages.h" | 45 #include "content/common/accessibility_messages.h" |
| 45 #include "content/common/frame_messages.h" | 46 #include "content/common/frame_messages.h" |
| 46 #include "content/common/input_messages.h" | 47 #include "content/common/input_messages.h" |
| 47 #include "content/common/inter_process_time_ticks_converter.h" | 48 #include "content/common/inter_process_time_ticks_converter.h" |
| 48 #include "content/common/navigation_params.h" | 49 #include "content/common/navigation_params.h" |
| 49 #include "content/common/render_frame_setup.mojom.h" | 50 #include "content/common/render_frame_setup.mojom.h" |
| 50 #include "content/common/site_isolation_policy.h" | 51 #include "content/common/site_isolation_policy.h" |
| 51 #include "content/common/swapped_out_messages.h" | 52 #include "content/common/swapped_out_messages.h" |
| 52 #include "content/public/browser/ax_event_notification_details.h" | 53 #include "content/public/browser/ax_event_notification_details.h" |
| 53 #include "content/public/browser/browser_accessibility_state.h" | 54 #include "content/public/browser/browser_accessibility_state.h" |
| (...skipping 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1583 // TODO(creis): Bind process ID here so that GeolocationServiceImpl | 1584 // TODO(creis): Bind process ID here so that GeolocationServiceImpl |
| 1584 // can perform permissions checks once site isolation is complete. | 1585 // can perform permissions checks once site isolation is complete. |
| 1585 // crbug.com/426384 | 1586 // crbug.com/426384 |
| 1586 GetServiceRegistry()->AddService<GeolocationService>( | 1587 GetServiceRegistry()->AddService<GeolocationService>( |
| 1587 base::Bind(&GeolocationServiceContext::CreateService, | 1588 base::Bind(&GeolocationServiceContext::CreateService, |
| 1588 base::Unretained(geolocation_service_context), | 1589 base::Unretained(geolocation_service_context), |
| 1589 base::Bind(&RenderFrameHostImpl::DidUseGeolocationPermission, | 1590 base::Bind(&RenderFrameHostImpl::DidUseGeolocationPermission, |
| 1590 base::Unretained(this)))); | 1591 base::Unretained(this)))); |
| 1591 } | 1592 } |
| 1592 | 1593 |
| 1594 WakeLockServiceContext* wake_lock_service_context = |
| 1595 delegate_ ? delegate_->GetWakeLockServiceContext() : nullptr; |
| 1596 if (wake_lock_service_context) { |
| 1597 int frame_id = frame_tree_node()->frame_tree_node_id(); |
| 1598 |
| 1599 // WakeLockServiceContext is owned by WebContentsImpl so it will outlive |
| 1600 // this RenderFrameHostImpl, hence a raw pointer can be bound to service |
| 1601 // factory callback. |
| 1602 GetServiceRegistry()->AddService<WakeLockService>( |
| 1603 base::Bind(&WakeLockServiceContext::CreateService, |
| 1604 base::Unretained(wake_lock_service_context), |
| 1605 frame_id)); |
| 1606 } |
| 1607 |
| 1593 if (!permission_service_context_) | 1608 if (!permission_service_context_) |
| 1594 permission_service_context_.reset(new PermissionServiceContext(this)); | 1609 permission_service_context_.reset(new PermissionServiceContext(this)); |
| 1595 | 1610 |
| 1596 GetServiceRegistry()->AddService<PermissionService>( | 1611 GetServiceRegistry()->AddService<PermissionService>( |
| 1597 base::Bind(&PermissionServiceContext::CreateService, | 1612 base::Bind(&PermissionServiceContext::CreateService, |
| 1598 base::Unretained(permission_service_context_.get()))); | 1613 base::Unretained(permission_service_context_.get()))); |
| 1599 | 1614 |
| 1600 GetServiceRegistry()->AddService<presentation::PresentationService>( | 1615 GetServiceRegistry()->AddService<presentation::PresentationService>( |
| 1601 base::Bind(&PresentationServiceImpl::CreateMojoService, | 1616 base::Bind(&PresentationServiceImpl::CreateMojoService, |
| 1602 base::Unretained(this))); | 1617 base::Unretained(this))); |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2215 BrowserPluginInstanceIDToAXTreeID(value))); | 2230 BrowserPluginInstanceIDToAXTreeID(value))); |
| 2216 break; | 2231 break; |
| 2217 case AX_CONTENT_INT_ATTRIBUTE_LAST: | 2232 case AX_CONTENT_INT_ATTRIBUTE_LAST: |
| 2218 NOTREACHED(); | 2233 NOTREACHED(); |
| 2219 break; | 2234 break; |
| 2220 } | 2235 } |
| 2221 } | 2236 } |
| 2222 } | 2237 } |
| 2223 | 2238 |
| 2224 } // namespace content | 2239 } // namespace content |
| OLD | NEW |