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 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1858 } | 1858 } |
1859 | 1859 |
1860 void RenderFrameHostImpl::InvalidateMojoConnection() { | 1860 void RenderFrameHostImpl::InvalidateMojoConnection() { |
1861 #if defined(OS_ANDROID) | 1861 #if defined(OS_ANDROID) |
1862 // The Android-specific service registry has a reference to | 1862 // The Android-specific service registry has a reference to |
1863 // |service_registry_| and thus must be torn down first. | 1863 // |service_registry_| and thus must be torn down first. |
1864 service_registry_android_.reset(); | 1864 service_registry_android_.reset(); |
1865 #endif | 1865 #endif |
1866 | 1866 |
1867 service_registry_.reset(); | 1867 service_registry_.reset(); |
| 1868 |
| 1869 // Disconnect with ImageDownloader Mojo service in RenderFrame. |
| 1870 image_downloader_dispatcher_.reset(); |
1868 } | 1871 } |
1869 | 1872 |
1870 bool RenderFrameHostImpl::IsFocused() { | 1873 bool RenderFrameHostImpl::IsFocused() { |
1871 // TODO(mlamouri,kenrb): call GetRenderWidgetHost() directly when it stops | 1874 // TODO(mlamouri,kenrb): call GetRenderWidgetHost() directly when it stops |
1872 // returning nullptr in some cases. See https://crbug.com/455245. | 1875 // returning nullptr in some cases. See https://crbug.com/455245. |
1873 return RenderWidgetHostImpl::From( | 1876 return RenderWidgetHostImpl::From( |
1874 GetView()->GetRenderWidgetHost())->is_focused() && | 1877 GetView()->GetRenderWidgetHost())->is_focused() && |
1875 frame_tree_->GetFocusedFrame() && | 1878 frame_tree_->GetFocusedFrame() && |
1876 (frame_tree_->GetFocusedFrame() == frame_tree_node() || | 1879 (frame_tree_->GetFocusedFrame() == frame_tree_node() || |
1877 frame_tree_->GetFocusedFrame()->IsDescendantOf(frame_tree_node())); | 1880 frame_tree_->GetFocusedFrame()->IsDescendantOf(frame_tree_node())); |
1878 } | 1881 } |
1879 | 1882 |
| 1883 int RenderFrameHostImpl::DownloadImage( |
| 1884 const GURL& url, |
| 1885 bool is_favicon, |
| 1886 uint32_t max_bitmap_size, |
| 1887 bool bypass_cache, |
| 1888 const WebContents::ImageDownloadCallback& callback) { |
| 1889 if (!image_downloader_dispatcher_) |
| 1890 image_downloader_dispatcher_.reset(new ImageDownloaderDispatcher(this)); |
| 1891 |
| 1892 return image_downloader_dispatcher_->StartDownload( |
| 1893 url, is_favicon, max_bitmap_size, bypass_cache, callback); |
| 1894 } |
| 1895 |
1880 void RenderFrameHostImpl::UpdateCrossProcessIframeAccessibility( | 1896 void RenderFrameHostImpl::UpdateCrossProcessIframeAccessibility( |
1881 const std::map<int32, int>& node_to_frame_routing_id_map) { | 1897 const std::map<int32, int>& node_to_frame_routing_id_map) { |
1882 for (const auto& iter : node_to_frame_routing_id_map) { | 1898 for (const auto& iter : node_to_frame_routing_id_map) { |
1883 // This is the id of the accessibility node that has a child frame. | 1899 // This is the id of the accessibility node that has a child frame. |
1884 int32 node_id = iter.first; | 1900 int32 node_id = iter.first; |
1885 // The routing id from either a RenderFrame or a RenderFrameProxy. | 1901 // The routing id from either a RenderFrame or a RenderFrameProxy. |
1886 int frame_routing_id = iter.second; | 1902 int frame_routing_id = iter.second; |
1887 | 1903 |
1888 FrameTree* frame_tree = frame_tree_node()->frame_tree(); | 1904 FrameTree* frame_tree = frame_tree_node()->frame_tree(); |
1889 FrameTreeNode* child_frame_tree_node = frame_tree->FindByRoutingID( | 1905 FrameTreeNode* child_frame_tree_node = frame_tree->FindByRoutingID( |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2100 } | 2116 } |
2101 | 2117 |
2102 std::string RenderFrameHostImpl::CommitCountString() { | 2118 std::string RenderFrameHostImpl::CommitCountString() { |
2103 std::string result = base::Int64ToString(reinterpret_cast<int64_t>(this)); | 2119 std::string result = base::Int64ToString(reinterpret_cast<int64_t>(this)); |
2104 result += "/"; | 2120 result += "/"; |
2105 result += base::IntToString(commit_count_); | 2121 result += base::IntToString(commit_count_); |
2106 return result; | 2122 return result; |
2107 } | 2123 } |
2108 | 2124 |
2109 } // namespace content | 2125 } // namespace content |
OLD | NEW |