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 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1743 } | 1743 } |
1744 | 1744 |
1745 void RenderFrameHostImpl::InvalidateMojoConnection() { | 1745 void RenderFrameHostImpl::InvalidateMojoConnection() { |
1746 #if defined(OS_ANDROID) | 1746 #if defined(OS_ANDROID) |
1747 // The Android-specific service registry has a reference to | 1747 // The Android-specific service registry has a reference to |
1748 // |service_registry_| and thus must be torn down first. | 1748 // |service_registry_| and thus must be torn down first. |
1749 service_registry_android_.reset(); | 1749 service_registry_android_.reset(); |
1750 #endif | 1750 #endif |
1751 | 1751 |
1752 service_registry_.reset(); | 1752 service_registry_.reset(); |
1753 | |
1754 // Disconnect with ImageDownloader Mojo service in render frame. | |
nasko
2015/04/15 20:57:22
nit: s/render frame/RenderFrame/
leonhsl(Using Gerrit)
2015/04/17 06:14:34
Done.
| |
1755 image_downloader_dispatcher_.reset(); | |
1753 } | 1756 } |
1754 | 1757 |
1755 bool RenderFrameHostImpl::IsFocused() { | 1758 bool RenderFrameHostImpl::IsFocused() { |
1756 // TODO(mlamouri,kenrb): call GetRenderWidgetHost() directly when it stops | 1759 // TODO(mlamouri,kenrb): call GetRenderWidgetHost() directly when it stops |
1757 // returning nullptr in some cases. See https://crbug.com/455245. | 1760 // returning nullptr in some cases. See https://crbug.com/455245. |
1758 return RenderWidgetHostImpl::From( | 1761 return RenderWidgetHostImpl::From( |
1759 GetView()->GetRenderWidgetHost())->is_focused() && | 1762 GetView()->GetRenderWidgetHost())->is_focused() && |
1760 frame_tree_->GetFocusedFrame() && | 1763 frame_tree_->GetFocusedFrame() && |
1761 (frame_tree_->GetFocusedFrame() == frame_tree_node() || | 1764 (frame_tree_->GetFocusedFrame() == frame_tree_node() || |
1762 frame_tree_->GetFocusedFrame()->IsDescendantOf(frame_tree_node())); | 1765 frame_tree_->GetFocusedFrame()->IsDescendantOf(frame_tree_node())); |
1763 } | 1766 } |
1764 | 1767 |
1768 int RenderFrameHostImpl::DownloadImage( | |
1769 const GURL& url, | |
1770 bool is_favicon, | |
1771 uint32_t max_bitmap_size, | |
1772 bool bypass_cache, | |
1773 const WebContents::ImageDownloadCallback& callback) { | |
1774 if (!image_downloader_dispatcher_) | |
1775 image_downloader_dispatcher_.reset(new ImageDownloaderDispatcher(this)); | |
1776 | |
1777 return image_downloader_dispatcher_->StartDownload( | |
1778 url, is_favicon, max_bitmap_size, bypass_cache, callback); | |
1779 } | |
1780 | |
1765 void RenderFrameHostImpl::UpdateCrossProcessIframeAccessibility( | 1781 void RenderFrameHostImpl::UpdateCrossProcessIframeAccessibility( |
1766 const std::map<int32, int>& node_to_frame_routing_id_map) { | 1782 const std::map<int32, int>& node_to_frame_routing_id_map) { |
1767 for (const auto& iter : node_to_frame_routing_id_map) { | 1783 for (const auto& iter : node_to_frame_routing_id_map) { |
1768 // This is the id of the accessibility node that has a child frame. | 1784 // This is the id of the accessibility node that has a child frame. |
1769 int32 node_id = iter.first; | 1785 int32 node_id = iter.first; |
1770 // The routing id from either a RenderFrame or a RenderFrameProxy. | 1786 // The routing id from either a RenderFrame or a RenderFrameProxy. |
1771 int frame_routing_id = iter.second; | 1787 int frame_routing_id = iter.second; |
1772 | 1788 |
1773 FrameTree* frame_tree = frame_tree_node()->frame_tree(); | 1789 FrameTree* frame_tree = frame_tree_node()->frame_tree(); |
1774 FrameTreeNode* child_frame_tree_node = frame_tree->FindByRoutingID( | 1790 FrameTreeNode* child_frame_tree_node = frame_tree->FindByRoutingID( |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1955 return; | 1971 return; |
1956 | 1972 |
1957 permission_manager->RegisterPermissionUsage( | 1973 permission_manager->RegisterPermissionUsage( |
1958 PermissionType::GEOLOCATION, | 1974 PermissionType::GEOLOCATION, |
1959 GetLastCommittedURL().GetOrigin(), | 1975 GetLastCommittedURL().GetOrigin(), |
1960 frame_tree_node()->frame_tree()->GetMainFrame() | 1976 frame_tree_node()->frame_tree()->GetMainFrame() |
1961 ->GetLastCommittedURL().GetOrigin()); | 1977 ->GetLastCommittedURL().GetOrigin()); |
1962 } | 1978 } |
1963 | 1979 |
1964 } // namespace content | 1980 } // namespace content |
OLD | NEW |