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 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6744 #endif | 6746 #endif |
6745 | 6747 |
6746 return nullptr; | 6748 return nullptr; |
6747 } | 6749 } |
6748 | 6750 |
6749 void RenderFrameImpl::SendFindReply(int request_id, | 6751 void RenderFrameImpl::SendFindReply(int request_id, |
6750 int match_count, | 6752 int match_count, |
6751 int ordinal, | 6753 int ordinal, |
6752 const WebRect& selection_rect, | 6754 const WebRect& selection_rect, |
6753 bool final_status_update) { | 6755 bool final_status_update) { |
6754 DCHECK(ordinal >= -1); | 6756 DCHECK_GE(ordinal, -1); |
6755 | 6757 |
6756 Send(new FrameHostMsg_Find_Reply(routing_id_, | 6758 Send(new FrameHostMsg_Find_Reply(routing_id_, |
6757 request_id, | 6759 request_id, |
6758 match_count, | 6760 match_count, |
6759 selection_rect, | 6761 selection_rect, |
6760 ordinal, | 6762 ordinal, |
6761 final_status_update)); | 6763 final_status_update)); |
6762 } | 6764 } |
6763 | 6765 |
6764 #if BUILDFLAG(ENABLE_PLUGINS) | 6766 #if BUILDFLAG(ENABLE_PLUGINS) |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6874 policy(info.default_policy), | 6876 policy(info.default_policy), |
6875 replaces_current_history_item(info.replaces_current_history_item), | 6877 replaces_current_history_item(info.replaces_current_history_item), |
6876 history_navigation_in_new_child_frame( | 6878 history_navigation_in_new_child_frame( |
6877 info.is_history_navigation_in_new_child_frame), | 6879 info.is_history_navigation_in_new_child_frame), |
6878 client_redirect(info.is_client_redirect), | 6880 client_redirect(info.is_client_redirect), |
6879 cache_disabled(info.is_cache_disabled), | 6881 cache_disabled(info.is_cache_disabled), |
6880 form(info.form), | 6882 form(info.form), |
6881 source_location(info.source_location) {} | 6883 source_location(info.source_location) {} |
6882 | 6884 |
6883 } // namespace content | 6885 } // namespace content |
OLD | NEW |