| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1830 if (geolocation_service_context) { | 1830 if (geolocation_service_context) { |
| 1831 // TODO(creis): Bind process ID here so that GeolocationServiceImpl | 1831 // TODO(creis): Bind process ID here so that GeolocationServiceImpl |
| 1832 // can perform permissions checks once site isolation is complete. | 1832 // can perform permissions checks once site isolation is complete. |
| 1833 // crbug.com/426384 | 1833 // crbug.com/426384 |
| 1834 // NOTE: At shutdown, there is no guaranteed ordering between destruction of | 1834 // NOTE: At shutdown, there is no guaranteed ordering between destruction of |
| 1835 // this object and destruction of any GeolocationServicesImpls created via | 1835 // this object and destruction of any GeolocationServicesImpls created via |
| 1836 // the below service registry, the reason being that the destruction of the | 1836 // the below service registry, the reason being that the destruction of the |
| 1837 // latter is triggered by receiving a message that the pipe was closed from | 1837 // latter is triggered by receiving a message that the pipe was closed from |
| 1838 // the renderer side. Hence, supply the reference to this object as a weak | 1838 // the renderer side. Hence, supply the reference to this object as a weak |
| 1839 // pointer. | 1839 // pointer. |
| 1840 GetServiceRegistry()->AddService<GeolocationService>( | 1840 GetServiceRegistry()->AddService( |
| 1841 base::Bind(&GeolocationServiceContext::CreateService, | 1841 base::Bind(&GeolocationServiceContext::CreateService, |
| 1842 base::Unretained(geolocation_service_context), | 1842 base::Unretained(geolocation_service_context), |
| 1843 base::Bind(&RenderFrameHostImpl::DidUseGeolocationPermission, | 1843 base::Bind(&RenderFrameHostImpl::DidUseGeolocationPermission, |
| 1844 weak_ptr_factory_.GetWeakPtr()))); | 1844 weak_ptr_factory_.GetWeakPtr()))); |
| 1845 } | 1845 } |
| 1846 | 1846 |
| 1847 WakeLockServiceContext* wake_lock_service_context = | 1847 WakeLockServiceContext* wake_lock_service_context = |
| 1848 delegate_ ? delegate_->GetWakeLockServiceContext() : nullptr; | 1848 delegate_ ? delegate_->GetWakeLockServiceContext() : nullptr; |
| 1849 if (wake_lock_service_context) { | 1849 if (wake_lock_service_context) { |
| 1850 // WakeLockServiceContext is owned by WebContentsImpl so it will outlive | 1850 // WakeLockServiceContext is owned by WebContentsImpl so it will outlive |
| 1851 // this RenderFrameHostImpl, hence a raw pointer can be bound to service | 1851 // this RenderFrameHostImpl, hence a raw pointer can be bound to service |
| 1852 // factory callback. | 1852 // factory callback. |
| 1853 GetServiceRegistry()->AddService<WakeLockService>( | 1853 GetServiceRegistry()->AddService<WakeLockService>( |
| 1854 base::Bind(&WakeLockServiceContext::CreateService, | 1854 base::Bind(&WakeLockServiceContext::CreateService, |
| 1855 base::Unretained(wake_lock_service_context), | 1855 base::Unretained(wake_lock_service_context), |
| 1856 GetProcess()->GetID(), GetRoutingID())); | 1856 GetProcess()->GetID(), GetRoutingID())); |
| 1857 } | 1857 } |
| 1858 | 1858 |
| 1859 if (!permission_service_context_) | 1859 if (!permission_service_context_) |
| 1860 permission_service_context_.reset(new PermissionServiceContext(this)); | 1860 permission_service_context_.reset(new PermissionServiceContext(this)); |
| 1861 | 1861 |
| 1862 GetServiceRegistry()->AddService<PermissionService>( | 1862 GetServiceRegistry()->AddService( |
| 1863 base::Bind(&PermissionServiceContext::CreateService, | 1863 base::Bind(&PermissionServiceContext::CreateService, |
| 1864 base::Unretained(permission_service_context_.get()))); | 1864 base::Unretained(permission_service_context_.get()))); |
| 1865 | 1865 |
| 1866 GetServiceRegistry()->AddService(base::Bind( | 1866 GetServiceRegistry()->AddService(base::Bind( |
| 1867 &PresentationServiceImpl::CreateMojoService, base::Unretained(this))); | 1867 &PresentationServiceImpl::CreateMojoService, base::Unretained(this))); |
| 1868 | 1868 |
| 1869 if (!frame_mojo_shell_) | 1869 if (!frame_mojo_shell_) |
| 1870 frame_mojo_shell_.reset(new FrameMojoShell(this)); | 1870 frame_mojo_shell_.reset(new FrameMojoShell(this)); |
| 1871 | 1871 |
| 1872 GetServiceRegistry()->AddService<mojo::shell::mojom::Connector>(base::Bind( | 1872 GetServiceRegistry()->AddService<mojo::shell::mojom::Connector>(base::Bind( |
| (...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2706 FrameTreeNode* focused_frame_tree_node = frame_tree_->GetFocusedFrame(); | 2706 FrameTreeNode* focused_frame_tree_node = frame_tree_->GetFocusedFrame(); |
| 2707 if (!focused_frame_tree_node) | 2707 if (!focused_frame_tree_node) |
| 2708 return; | 2708 return; |
| 2709 RenderFrameHostImpl* focused_frame = | 2709 RenderFrameHostImpl* focused_frame = |
| 2710 focused_frame_tree_node->current_frame_host(); | 2710 focused_frame_tree_node->current_frame_host(); |
| 2711 DCHECK(focused_frame); | 2711 DCHECK(focused_frame); |
| 2712 dst->focused_tree_id = focused_frame->GetAXTreeID(); | 2712 dst->focused_tree_id = focused_frame->GetAXTreeID(); |
| 2713 } | 2713 } |
| 2714 | 2714 |
| 2715 } // namespace content | 2715 } // namespace content |
| OLD | NEW |