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 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1574 // TODO(creis): Bind process ID here so that GeolocationServiceImpl | 1575 // TODO(creis): Bind process ID here so that GeolocationServiceImpl |
1575 // can perform permissions checks once site isolation is complete. | 1576 // can perform permissions checks once site isolation is complete. |
1576 // crbug.com/426384 | 1577 // crbug.com/426384 |
1577 GetServiceRegistry()->AddService<GeolocationService>( | 1578 GetServiceRegistry()->AddService<GeolocationService>( |
1578 base::Bind(&GeolocationServiceContext::CreateService, | 1579 base::Bind(&GeolocationServiceContext::CreateService, |
1579 base::Unretained(geolocation_service_context), | 1580 base::Unretained(geolocation_service_context), |
1580 base::Bind(&RenderFrameHostImpl::DidUseGeolocationPermission, | 1581 base::Bind(&RenderFrameHostImpl::DidUseGeolocationPermission, |
1581 base::Unretained(this)))); | 1582 base::Unretained(this)))); |
1582 } | 1583 } |
1583 | 1584 |
| 1585 WakeLockServiceContext* wake_lock_service_context = |
| 1586 delegate_ ? delegate_->GetWakeLockServiceContext() : nullptr; |
| 1587 if (wake_lock_service_context) { |
| 1588 // WakeLockServiceContext is owned by WebContentsImpl so it will outlive |
| 1589 // this RenderFrameHostImpl, hence a raw pointer can be bound to service |
| 1590 // factory callback. |
| 1591 GetServiceRegistry()->AddService<WakeLockService>( |
| 1592 base::Bind(&WakeLockServiceContext::CreateService, |
| 1593 base::Unretained(wake_lock_service_context), |
| 1594 GetProcess()->GetID(), GetRoutingID())); |
| 1595 } |
| 1596 |
1584 if (!permission_service_context_) | 1597 if (!permission_service_context_) |
1585 permission_service_context_.reset(new PermissionServiceContext(this)); | 1598 permission_service_context_.reset(new PermissionServiceContext(this)); |
1586 | 1599 |
1587 GetServiceRegistry()->AddService<PermissionService>( | 1600 GetServiceRegistry()->AddService<PermissionService>( |
1588 base::Bind(&PermissionServiceContext::CreateService, | 1601 base::Bind(&PermissionServiceContext::CreateService, |
1589 base::Unretained(permission_service_context_.get()))); | 1602 base::Unretained(permission_service_context_.get()))); |
1590 | 1603 |
1591 GetServiceRegistry()->AddService<presentation::PresentationService>( | 1604 GetServiceRegistry()->AddService<presentation::PresentationService>( |
1592 base::Bind(&PresentationServiceImpl::CreateMojoService, | 1605 base::Bind(&PresentationServiceImpl::CreateMojoService, |
1593 base::Unretained(this))); | 1606 base::Unretained(this))); |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2225 BrowserPluginInstanceIDToAXTreeID(value))); | 2238 BrowserPluginInstanceIDToAXTreeID(value))); |
2226 break; | 2239 break; |
2227 case AX_CONTENT_INT_ATTRIBUTE_LAST: | 2240 case AX_CONTENT_INT_ATTRIBUTE_LAST: |
2228 NOTREACHED(); | 2241 NOTREACHED(); |
2229 break; | 2242 break; |
2230 } | 2243 } |
2231 } | 2244 } |
2232 } | 2245 } |
2233 | 2246 |
2234 } // namespace content | 2247 } // namespace content |
OLD | NEW |