| 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 2874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2891 | 2892 |
| 2892 return base::MakeUnique<RendererWebApplicationCacheHostImpl>( | 2893 return base::MakeUnique<RendererWebApplicationCacheHostImpl>( |
| 2893 RenderViewImpl::FromWebView(frame_->View()), client, | 2894 RenderViewImpl::FromWebView(frame_->View()), client, |
| 2894 RenderThreadImpl::current()->appcache_dispatcher()->backend_proxy(), | 2895 RenderThreadImpl::current()->appcache_dispatcher()->backend_proxy(), |
| 2895 navigation_state->request_params().appcache_host_id); | 2896 navigation_state->request_params().appcache_host_id); |
| 2896 } | 2897 } |
| 2897 | 2898 |
| 2898 std::unique_ptr<blink::WebContentSettingsClient> | 2899 std::unique_ptr<blink::WebContentSettingsClient> |
| 2899 RenderFrameImpl::CreateWorkerContentSettingsClient() { | 2900 RenderFrameImpl::CreateWorkerContentSettingsClient() { |
| 2900 if (!frame_ || !frame_->View()) | 2901 if (!frame_ || !frame_->View()) |
| 2901 return NULL; | 2902 return nullptr; |
| 2902 return GetContentClient()->renderer()->CreateWorkerContentSettingsClient( | 2903 return GetContentClient()->renderer()->CreateWorkerContentSettingsClient( |
| 2903 this, frame_); | 2904 this); |
| 2904 } | 2905 } |
| 2905 | 2906 |
| 2906 std::unique_ptr<blink::WebWorkerFetchContext> | 2907 std::unique_ptr<blink::WebWorkerFetchContext> |
| 2907 RenderFrameImpl::CreateWorkerFetchContext() { | 2908 RenderFrameImpl::CreateWorkerFetchContext() { |
| 2908 DCHECK(base::FeatureList::IsEnabled(features::kOffMainThreadFetch)); | 2909 DCHECK(base::FeatureList::IsEnabled(features::kOffMainThreadFetch)); |
| 2909 mojom::WorkerURLLoaderFactoryProviderPtr worker_url_loader_factory_provider; | 2910 mojom::WorkerURLLoaderFactoryProviderPtr worker_url_loader_factory_provider; |
| 2910 RenderThreadImpl::current() | 2911 RenderThreadImpl::current() |
| 2911 ->blink_platform_impl() | 2912 ->blink_platform_impl() |
| 2912 ->GetInterfaceProvider() | 2913 ->GetInterfaceProvider() |
| 2913 ->GetInterface(mojo::MakeRequest(&worker_url_loader_factory_provider)); | 2914 ->GetInterface(mojo::MakeRequest(&worker_url_loader_factory_provider)); |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3756 if (url.is_valid() && url.spec() != url::kAboutBlankURL) { | 3757 if (url.is_valid() && url.spec() != url::kAboutBlankURL) { |
| 3757 // TODO(nasko): Check if webview()->mainFrame() is the same as the | 3758 // TODO(nasko): Check if webview()->mainFrame() is the same as the |
| 3758 // frame->tree()->top(). | 3759 // frame->tree()->top(). |
| 3759 blink::WebFrame* main_frame = render_view_->webview()->MainFrame(); | 3760 blink::WebFrame* main_frame = render_view_->webview()->MainFrame(); |
| 3760 if (frame == main_frame) { | 3761 if (frame == main_frame) { |
| 3761 // For now, don't remember plugin zoom values. We don't want to mix them | 3762 // For now, don't remember plugin zoom values. We don't want to mix them |
| 3762 // with normal web content (i.e. a fixed layout plugin would usually want | 3763 // with normal web content (i.e. a fixed layout plugin would usually want |
| 3763 // them different). | 3764 // them different). |
| 3764 render_view_->Send(new ViewHostMsg_DocumentAvailableInMainFrame( | 3765 render_view_->Send(new ViewHostMsg_DocumentAvailableInMainFrame( |
| 3765 render_view_->GetRoutingID(), | 3766 render_view_->GetRoutingID(), |
| 3766 main_frame->GetDocument().IsPluginDocument())); | 3767 frame->GetDocument().IsPluginDocument())); |
| 3767 } | 3768 } |
| 3768 } | 3769 } |
| 3769 | 3770 |
| 3770 for (auto& observer : observers_) | 3771 for (auto& observer : observers_) |
| 3771 observer.DidCreateDocumentElement(); | 3772 observer.DidCreateDocumentElement(); |
| 3772 } | 3773 } |
| 3773 | 3774 |
| 3774 void RenderFrameImpl::RunScriptsAtDocumentElementAvailable( | 3775 void RenderFrameImpl::RunScriptsAtDocumentElementAvailable( |
| 3775 blink::WebLocalFrame* frame) { | 3776 blink::WebLocalFrame* frame) { |
| 3776 DCHECK(!frame_ || frame_ == frame); | 3777 DCHECK(!frame_ || frame_ == frame); |
| (...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4902 ZoomFactorToZoomLevel(kMinimumZoomFactor), | 4903 ZoomFactorToZoomLevel(kMinimumZoomFactor), |
| 4903 ZoomFactorToZoomLevel(kMaximumZoomFactor)); | 4904 ZoomFactorToZoomLevel(kMaximumZoomFactor)); |
| 4904 | 4905 |
| 4905 // Set zoom level, but don't do it for full-page plugin since they don't use | 4906 // Set zoom level, but don't do it for full-page plugin since they don't use |
| 4906 // the same zoom settings. | 4907 // the same zoom settings. |
| 4907 HostZoomLevels::iterator host_zoom = | 4908 HostZoomLevels::iterator host_zoom = |
| 4908 host_zoom_levels_.find(GURL(request.Url())); | 4909 host_zoom_levels_.find(GURL(request.Url())); |
| 4909 if (render_view_->webview()->MainFrame()->IsWebLocalFrame() && | 4910 if (render_view_->webview()->MainFrame()->IsWebLocalFrame() && |
| 4910 render_view_->webview() | 4911 render_view_->webview() |
| 4911 ->MainFrame() | 4912 ->MainFrame() |
| 4913 ->ToWebLocalFrame() |
| 4912 ->GetDocument() | 4914 ->GetDocument() |
| 4913 .IsPluginDocument()) { | 4915 .IsPluginDocument()) { |
| 4914 // Reset the zoom levels for plugins. | 4916 // Reset the zoom levels for plugins. |
| 4915 render_view_->SetZoomLevel(0); | 4917 render_view_->SetZoomLevel(0); |
| 4916 } else { | 4918 } else { |
| 4917 // If the zoom level is not found, then do nothing. In-page navigation | 4919 // If the zoom level is not found, then do nothing. In-page navigation |
| 4918 // relies on not changing the zoom level in this case. | 4920 // relies on not changing the zoom level in this case. |
| 4919 if (host_zoom != host_zoom_levels_.end()) | 4921 if (host_zoom != host_zoom_levels_.end()) |
| 4920 render_view_->SetZoomLevel(host_zoom->second); | 4922 render_view_->SetZoomLevel(host_zoom->second); |
| 4921 } | 4923 } |
| (...skipping 1822 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 triggering_event_info(info.triggering_event_info), | 6881 triggering_event_info(info.triggering_event_info), |
| 6880 cache_disabled(info.is_cache_disabled), | 6882 cache_disabled(info.is_cache_disabled), |
| 6881 form(info.form), | 6883 form(info.form), |
| 6882 source_location(info.source_location) {} | 6884 source_location(info.source_location) {} |
| 6883 | 6885 |
| 6884 } // namespace content | 6886 } // namespace content |
| OLD | NEW |