| 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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> |
| 7 #include <map> | 8 #include <map> |
| 8 #include <string> | 9 #include <string> |
| 9 #include <utility> | 10 #include <utility> |
| 10 #include <vector> | 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/auto_reset.h" | 13 #include "base/auto_reset.h" |
| 13 #include "base/bind_helpers.h" | 14 #include "base/bind_helpers.h" |
| 14 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 15 #include "base/debug/alias.h" | 16 #include "base/debug/alias.h" |
| 16 #include "base/debug/asan_invalid_access.h" | 17 #include "base/debug/asan_invalid_access.h" |
| (...skipping 2873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2890 | 2891 |
| 2891 return base::MakeUnique<RendererWebApplicationCacheHostImpl>( | 2892 return base::MakeUnique<RendererWebApplicationCacheHostImpl>( |
| 2892 RenderViewImpl::FromWebView(frame_->View()), client, | 2893 RenderViewImpl::FromWebView(frame_->View()), client, |
| 2893 RenderThreadImpl::current()->appcache_dispatcher()->backend_proxy(), | 2894 RenderThreadImpl::current()->appcache_dispatcher()->backend_proxy(), |
| 2894 navigation_state->request_params().appcache_host_id); | 2895 navigation_state->request_params().appcache_host_id); |
| 2895 } | 2896 } |
| 2896 | 2897 |
| 2897 std::unique_ptr<blink::WebContentSettingsClient> | 2898 std::unique_ptr<blink::WebContentSettingsClient> |
| 2898 RenderFrameImpl::CreateWorkerContentSettingsClient() { | 2899 RenderFrameImpl::CreateWorkerContentSettingsClient() { |
| 2899 if (!frame_ || !frame_->View()) | 2900 if (!frame_ || !frame_->View()) |
| 2900 return NULL; | 2901 return nullptr; |
| 2901 return GetContentClient()->renderer()->CreateWorkerContentSettingsClient( | 2902 return GetContentClient()->renderer()->CreateWorkerContentSettingsClient( |
| 2902 this, frame_); | 2903 this); |
| 2903 } | 2904 } |
| 2904 | 2905 |
| 2905 std::unique_ptr<blink::WebWorkerFetchContext> | 2906 std::unique_ptr<blink::WebWorkerFetchContext> |
| 2906 RenderFrameImpl::CreateWorkerFetchContext() { | 2907 RenderFrameImpl::CreateWorkerFetchContext() { |
| 2907 DCHECK(base::FeatureList::IsEnabled(features::kOffMainThreadFetch)); | 2908 DCHECK(base::FeatureList::IsEnabled(features::kOffMainThreadFetch)); |
| 2908 mojom::WorkerURLLoaderFactoryProviderPtr worker_url_loader_factory_provider; | 2909 mojom::WorkerURLLoaderFactoryProviderPtr worker_url_loader_factory_provider; |
| 2909 RenderThreadImpl::current() | 2910 RenderThreadImpl::current() |
| 2910 ->blink_platform_impl() | 2911 ->blink_platform_impl() |
| 2911 ->GetInterfaceProvider() | 2912 ->GetInterfaceProvider() |
| 2912 ->GetInterface(mojo::MakeRequest(&worker_url_loader_factory_provider)); | 2913 ->GetInterface(mojo::MakeRequest(&worker_url_loader_factory_provider)); |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3757 if (url.is_valid() && url.spec() != url::kAboutBlankURL) { | 3758 if (url.is_valid() && url.spec() != url::kAboutBlankURL) { |
| 3758 // TODO(nasko): Check if webview()->mainFrame() is the same as the | 3759 // TODO(nasko): Check if webview()->mainFrame() is the same as the |
| 3759 // frame->tree()->top(). | 3760 // frame->tree()->top(). |
| 3760 blink::WebFrame* main_frame = render_view_->webview()->MainFrame(); | 3761 blink::WebFrame* main_frame = render_view_->webview()->MainFrame(); |
| 3761 if (frame == main_frame) { | 3762 if (frame == main_frame) { |
| 3762 // For now, don't remember plugin zoom values. We don't want to mix them | 3763 // For now, don't remember plugin zoom values. We don't want to mix them |
| 3763 // with normal web content (i.e. a fixed layout plugin would usually want | 3764 // with normal web content (i.e. a fixed layout plugin would usually want |
| 3764 // them different). | 3765 // them different). |
| 3765 render_view_->Send(new ViewHostMsg_DocumentAvailableInMainFrame( | 3766 render_view_->Send(new ViewHostMsg_DocumentAvailableInMainFrame( |
| 3766 render_view_->GetRoutingID(), | 3767 render_view_->GetRoutingID(), |
| 3767 main_frame->GetDocument().IsPluginDocument())); | 3768 frame->GetDocument().IsPluginDocument())); |
| 3768 } | 3769 } |
| 3769 } | 3770 } |
| 3770 | 3771 |
| 3771 for (auto& observer : observers_) | 3772 for (auto& observer : observers_) |
| 3772 observer.DidCreateDocumentElement(); | 3773 observer.DidCreateDocumentElement(); |
| 3773 } | 3774 } |
| 3774 | 3775 |
| 3775 void RenderFrameImpl::RunScriptsAtDocumentElementAvailable( | 3776 void RenderFrameImpl::RunScriptsAtDocumentElementAvailable( |
| 3776 blink::WebLocalFrame* frame) { | 3777 blink::WebLocalFrame* frame) { |
| 3777 DCHECK(!frame_ || frame_ == frame); | 3778 DCHECK(!frame_ || frame_ == frame); |
| (...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4903 ZoomFactorToZoomLevel(kMinimumZoomFactor), | 4904 ZoomFactorToZoomLevel(kMinimumZoomFactor), |
| 4904 ZoomFactorToZoomLevel(kMaximumZoomFactor)); | 4905 ZoomFactorToZoomLevel(kMaximumZoomFactor)); |
| 4905 | 4906 |
| 4906 // Set zoom level, but don't do it for full-page plugin since they don't use | 4907 // Set zoom level, but don't do it for full-page plugin since they don't use |
| 4907 // the same zoom settings. | 4908 // the same zoom settings. |
| 4908 HostZoomLevels::iterator host_zoom = | 4909 HostZoomLevels::iterator host_zoom = |
| 4909 host_zoom_levels_.find(GURL(request.Url())); | 4910 host_zoom_levels_.find(GURL(request.Url())); |
| 4910 if (render_view_->webview()->MainFrame()->IsWebLocalFrame() && | 4911 if (render_view_->webview()->MainFrame()->IsWebLocalFrame() && |
| 4911 render_view_->webview() | 4912 render_view_->webview() |
| 4912 ->MainFrame() | 4913 ->MainFrame() |
| 4914 ->ToWebLocalFrame() |
| 4913 ->GetDocument() | 4915 ->GetDocument() |
| 4914 .IsPluginDocument()) { | 4916 .IsPluginDocument()) { |
| 4915 // Reset the zoom levels for plugins. | 4917 // Reset the zoom levels for plugins. |
| 4916 render_view_->SetZoomLevel(0); | 4918 render_view_->SetZoomLevel(0); |
| 4917 } else { | 4919 } else { |
| 4918 // If the zoom level is not found, then do nothing. In-page navigation | 4920 // If the zoom level is not found, then do nothing. In-page navigation |
| 4919 // relies on not changing the zoom level in this case. | 4921 // relies on not changing the zoom level in this case. |
| 4920 if (host_zoom != host_zoom_levels_.end()) | 4922 if (host_zoom != host_zoom_levels_.end()) |
| 4921 render_view_->SetZoomLevel(host_zoom->second); | 4923 render_view_->SetZoomLevel(host_zoom->second); |
| 4922 } | 4924 } |
| (...skipping 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6732 #endif | 6734 #endif |
| 6733 | 6735 |
| 6734 return nullptr; | 6736 return nullptr; |
| 6735 } | 6737 } |
| 6736 | 6738 |
| 6737 void RenderFrameImpl::SendFindReply(int request_id, | 6739 void RenderFrameImpl::SendFindReply(int request_id, |
| 6738 int match_count, | 6740 int match_count, |
| 6739 int ordinal, | 6741 int ordinal, |
| 6740 const WebRect& selection_rect, | 6742 const WebRect& selection_rect, |
| 6741 bool final_status_update) { | 6743 bool final_status_update) { |
| 6742 DCHECK(ordinal >= -1); | 6744 DCHECK_GE(ordinal, -1); |
| 6743 | 6745 |
| 6744 Send(new FrameHostMsg_Find_Reply(routing_id_, | 6746 Send(new FrameHostMsg_Find_Reply(routing_id_, |
| 6745 request_id, | 6747 request_id, |
| 6746 match_count, | 6748 match_count, |
| 6747 selection_rect, | 6749 selection_rect, |
| 6748 ordinal, | 6750 ordinal, |
| 6749 final_status_update)); | 6751 final_status_update)); |
| 6750 } | 6752 } |
| 6751 | 6753 |
| 6752 #if BUILDFLAG(ENABLE_PLUGINS) | 6754 #if BUILDFLAG(ENABLE_PLUGINS) |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6862 policy(info.default_policy), | 6864 policy(info.default_policy), |
| 6863 replaces_current_history_item(info.replaces_current_history_item), | 6865 replaces_current_history_item(info.replaces_current_history_item), |
| 6864 history_navigation_in_new_child_frame( | 6866 history_navigation_in_new_child_frame( |
| 6865 info.is_history_navigation_in_new_child_frame), | 6867 info.is_history_navigation_in_new_child_frame), |
| 6866 client_redirect(info.is_client_redirect), | 6868 client_redirect(info.is_client_redirect), |
| 6867 cache_disabled(info.is_cache_disabled), | 6869 cache_disabled(info.is_cache_disabled), |
| 6868 form(info.form), | 6870 form(info.form), |
| 6869 source_location(info.source_location) {} | 6871 source_location(info.source_location) {} |
| 6870 | 6872 |
| 6871 } // namespace content | 6873 } // namespace content |
| OLD | NEW |