Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(733)

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2928033002: Move GetDocument method from WebFrame to WebLocalFrame. (Closed)
Patch Set: Rebasing... Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
3752 if (url.is_valid() && url.spec() != url::kAboutBlankURL) { 3753 if (url.is_valid() && url.spec() != url::kAboutBlankURL) {
3753 // TODO(nasko): Check if webview()->mainFrame() is the same as the 3754 // TODO(nasko): Check if webview()->mainFrame() is the same as the
3754 // frame->tree()->top(). 3755 // frame->tree()->top().
3755 blink::WebFrame* main_frame = render_view_->webview()->MainFrame(); 3756 blink::WebFrame* main_frame = render_view_->webview()->MainFrame();
3756 if (frame == main_frame) { 3757 if (frame == main_frame) {
3757 // For now, don't remember plugin zoom values. We don't want to mix them 3758 // For now, don't remember plugin zoom values. We don't want to mix them
3758 // with normal web content (i.e. a fixed layout plugin would usually want 3759 // with normal web content (i.e. a fixed layout plugin would usually want
3759 // them different). 3760 // them different).
3760 render_view_->Send(new ViewHostMsg_DocumentAvailableInMainFrame( 3761 render_view_->Send(new ViewHostMsg_DocumentAvailableInMainFrame(
3761 render_view_->GetRoutingID(), 3762 render_view_->GetRoutingID(),
3762 main_frame->GetDocument().IsPluginDocument())); 3763 frame->GetDocument().IsPluginDocument()));
3763 } 3764 }
3764 } 3765 }
3765 3766
3766 for (auto& observer : observers_) 3767 for (auto& observer : observers_)
3767 observer.DidCreateDocumentElement(); 3768 observer.DidCreateDocumentElement();
3768 } 3769 }
3769 3770
3770 void RenderFrameImpl::RunScriptsAtDocumentElementAvailable( 3771 void RenderFrameImpl::RunScriptsAtDocumentElementAvailable(
3771 blink::WebLocalFrame* frame) { 3772 blink::WebLocalFrame* frame) {
3772 DCHECK(!frame_ || frame_ == frame); 3773 DCHECK(!frame_ || frame_ == frame);
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after
4898 ZoomFactorToZoomLevel(kMinimumZoomFactor), 4899 ZoomFactorToZoomLevel(kMinimumZoomFactor),
4899 ZoomFactorToZoomLevel(kMaximumZoomFactor)); 4900 ZoomFactorToZoomLevel(kMaximumZoomFactor));
4900 4901
4901 // Set zoom level, but don't do it for full-page plugin since they don't use 4902 // Set zoom level, but don't do it for full-page plugin since they don't use
4902 // the same zoom settings. 4903 // the same zoom settings.
4903 HostZoomLevels::iterator host_zoom = 4904 HostZoomLevels::iterator host_zoom =
4904 host_zoom_levels_.find(GURL(request.Url())); 4905 host_zoom_levels_.find(GURL(request.Url()));
4905 if (render_view_->webview()->MainFrame()->IsWebLocalFrame() && 4906 if (render_view_->webview()->MainFrame()->IsWebLocalFrame() &&
4906 render_view_->webview() 4907 render_view_->webview()
4907 ->MainFrame() 4908 ->MainFrame()
4909 ->ToWebLocalFrame()
4908 ->GetDocument() 4910 ->GetDocument()
4909 .IsPluginDocument()) { 4911 .IsPluginDocument()) {
4910 // Reset the zoom levels for plugins. 4912 // Reset the zoom levels for plugins.
4911 render_view_->SetZoomLevel(0); 4913 render_view_->SetZoomLevel(0);
4912 } else { 4914 } else {
4913 // If the zoom level is not found, then do nothing. In-page navigation 4915 // If the zoom level is not found, then do nothing. In-page navigation
4914 // relies on not changing the zoom level in this case. 4916 // relies on not changing the zoom level in this case.
4915 if (host_zoom != host_zoom_levels_.end()) 4917 if (host_zoom != host_zoom_levels_.end())
4916 render_view_->SetZoomLevel(host_zoom->second); 4918 render_view_->SetZoomLevel(host_zoom->second);
4917 } 4919 }
(...skipping 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after
6734 #endif 6736 #endif
6735 6737
6736 return nullptr; 6738 return nullptr;
6737 } 6739 }
6738 6740
6739 void RenderFrameImpl::SendFindReply(int request_id, 6741 void RenderFrameImpl::SendFindReply(int request_id,
6740 int match_count, 6742 int match_count,
6741 int ordinal, 6743 int ordinal,
6742 const WebRect& selection_rect, 6744 const WebRect& selection_rect,
6743 bool final_status_update) { 6745 bool final_status_update) {
6744 DCHECK(ordinal >= -1); 6746 DCHECK_GE(ordinal, -1);
6745 6747
6746 Send(new FrameHostMsg_Find_Reply(routing_id_, 6748 Send(new FrameHostMsg_Find_Reply(routing_id_,
6747 request_id, 6749 request_id,
6748 match_count, 6750 match_count,
6749 selection_rect, 6751 selection_rect,
6750 ordinal, 6752 ordinal,
6751 final_status_update)); 6753 final_status_update));
6752 } 6754 }
6753 6755
6754 #if BUILDFLAG(ENABLE_PLUGINS) 6756 #if BUILDFLAG(ENABLE_PLUGINS)
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
6864 policy(info.default_policy), 6866 policy(info.default_policy),
6865 replaces_current_history_item(info.replaces_current_history_item), 6867 replaces_current_history_item(info.replaces_current_history_item),
6866 history_navigation_in_new_child_frame( 6868 history_navigation_in_new_child_frame(
6867 info.is_history_navigation_in_new_child_frame), 6869 info.is_history_navigation_in_new_child_frame),
6868 client_redirect(info.is_client_redirect), 6870 client_redirect(info.is_client_redirect),
6869 cache_disabled(info.is_cache_disabled), 6871 cache_disabled(info.is_cache_disabled),
6870 form(info.form), 6872 form(info.form),
6871 source_location(info.source_location) {} 6873 source_location(info.source_location) {}
6872 6874
6873 } // namespace content 6875 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698