| 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 1834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1845 } | 1845 } |
| 1846 | 1846 |
| 1847 void RenderFrameHostImpl::InvalidateMojoConnection() { | 1847 void RenderFrameHostImpl::InvalidateMojoConnection() { |
| 1848 #if defined(OS_ANDROID) | 1848 #if defined(OS_ANDROID) |
| 1849 // The Android-specific service registry has a reference to | 1849 // The Android-specific service registry has a reference to |
| 1850 // |service_registry_| and thus must be torn down first. | 1850 // |service_registry_| and thus must be torn down first. |
| 1851 service_registry_android_.reset(); | 1851 service_registry_android_.reset(); |
| 1852 #endif | 1852 #endif |
| 1853 | 1853 |
| 1854 service_registry_.reset(); | 1854 service_registry_.reset(); |
| 1855 |
| 1856 // Disconnect with ImageDownloader Mojo service in RenderFrame. |
| 1857 mojo_image_downloader_.reset(); |
| 1855 } | 1858 } |
| 1856 | 1859 |
| 1857 bool RenderFrameHostImpl::IsFocused() { | 1860 bool RenderFrameHostImpl::IsFocused() { |
| 1858 // TODO(mlamouri,kenrb): call GetRenderWidgetHost() directly when it stops | 1861 // TODO(mlamouri,kenrb): call GetRenderWidgetHost() directly when it stops |
| 1859 // returning nullptr in some cases. See https://crbug.com/455245. | 1862 // returning nullptr in some cases. See https://crbug.com/455245. |
| 1860 return RenderWidgetHostImpl::From( | 1863 return RenderWidgetHostImpl::From( |
| 1861 GetView()->GetRenderWidgetHost())->is_focused() && | 1864 GetView()->GetRenderWidgetHost())->is_focused() && |
| 1862 frame_tree_->GetFocusedFrame() && | 1865 frame_tree_->GetFocusedFrame() && |
| 1863 (frame_tree_->GetFocusedFrame() == frame_tree_node() || | 1866 (frame_tree_->GetFocusedFrame() == frame_tree_node() || |
| 1864 frame_tree_->GetFocusedFrame()->IsDescendantOf(frame_tree_node())); | 1867 frame_tree_->GetFocusedFrame()->IsDescendantOf(frame_tree_node())); |
| 1865 } | 1868 } |
| 1866 | 1869 |
| 1870 const image_downloader::ImageDownloaderPtr& |
| 1871 RenderFrameHostImpl::GetMojoImageDownloader() { |
| 1872 if (!mojo_image_downloader_.get()) { |
| 1873 GetServiceRegistry()->ConnectToRemoteService( |
| 1874 mojo::GetProxy(&mojo_image_downloader_)); |
| 1875 } |
| 1876 return mojo_image_downloader_; |
| 1877 } |
| 1878 |
| 1867 void RenderFrameHostImpl::UpdateCrossProcessIframeAccessibility( | 1879 void RenderFrameHostImpl::UpdateCrossProcessIframeAccessibility( |
| 1868 const std::map<int32, int>& node_to_frame_routing_id_map) { | 1880 const std::map<int32, int>& node_to_frame_routing_id_map) { |
| 1869 for (const auto& iter : node_to_frame_routing_id_map) { | 1881 for (const auto& iter : node_to_frame_routing_id_map) { |
| 1870 // This is the id of the accessibility node that has a child frame. | 1882 // This is the id of the accessibility node that has a child frame. |
| 1871 int32 node_id = iter.first; | 1883 int32 node_id = iter.first; |
| 1872 // The routing id from either a RenderFrame or a RenderFrameProxy. | 1884 // The routing id from either a RenderFrame or a RenderFrameProxy. |
| 1873 int frame_routing_id = iter.second; | 1885 int frame_routing_id = iter.second; |
| 1874 | 1886 |
| 1875 FrameTree* frame_tree = frame_tree_node()->frame_tree(); | 1887 FrameTree* frame_tree = frame_tree_node()->frame_tree(); |
| 1876 FrameTreeNode* child_frame_tree_node = frame_tree->FindByRoutingID( | 1888 FrameTreeNode* child_frame_tree_node = frame_tree->FindByRoutingID( |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2089 // We may be returning to an existing NavigationEntry that had been granted | 2101 // We may be returning to an existing NavigationEntry that had been granted |
| 2090 // file access. If this is a different process, we will need to grant the | 2102 // file access. If this is a different process, we will need to grant the |
| 2091 // access again. The files listed in the page state are validated when they | 2103 // access again. The files listed in the page state are validated when they |
| 2092 // are received from the renderer to prevent abuse. | 2104 // are received from the renderer to prevent abuse. |
| 2093 if (request_params.page_state.IsValid()) { | 2105 if (request_params.page_state.IsValid()) { |
| 2094 render_view_host_->GrantFileAccessFromPageState(request_params.page_state); | 2106 render_view_host_->GrantFileAccessFromPageState(request_params.page_state); |
| 2095 } | 2107 } |
| 2096 } | 2108 } |
| 2097 | 2109 |
| 2098 } // namespace content | 2110 } // namespace content |
| OLD | NEW |