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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1685213002: Propagate window coordinates to out-of-process iframes renderers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sendscreenrects
Patch Set: addressing comments Created 4 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 27 matching lines...) Expand all
38 #include "content/browser/dom_storage/session_storage_namespace_impl.h" 38 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
39 #include "content/browser/download/download_stats.h" 39 #include "content/browser/download/download_stats.h"
40 #include "content/browser/download/mhtml_generation_manager.h" 40 #include "content/browser/download/mhtml_generation_manager.h"
41 #include "content/browser/download/save_package.h" 41 #include "content/browser/download/save_package.h"
42 #include "content/browser/frame_host/cross_process_frame_connector.h" 42 #include "content/browser/frame_host/cross_process_frame_connector.h"
43 #include "content/browser/frame_host/interstitial_page_impl.h" 43 #include "content/browser/frame_host/interstitial_page_impl.h"
44 #include "content/browser/frame_host/navigation_entry_impl.h" 44 #include "content/browser/frame_host/navigation_entry_impl.h"
45 #include "content/browser/frame_host/navigation_handle_impl.h" 45 #include "content/browser/frame_host/navigation_handle_impl.h"
46 #include "content/browser/frame_host/navigator_impl.h" 46 #include "content/browser/frame_host/navigator_impl.h"
47 #include "content/browser/frame_host/render_frame_host_impl.h" 47 #include "content/browser/frame_host/render_frame_host_impl.h"
48 #include "content/browser/frame_host/render_frame_proxy_host.h"
48 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" 49 #include "content/browser/frame_host/render_widget_host_view_child_frame.h"
49 #include "content/browser/geolocation/geolocation_service_context.h" 50 #include "content/browser/geolocation/geolocation_service_context.h"
50 #include "content/browser/host_zoom_map_impl.h" 51 #include "content/browser/host_zoom_map_impl.h"
51 #include "content/browser/loader/resource_dispatcher_host_impl.h" 52 #include "content/browser/loader/resource_dispatcher_host_impl.h"
52 #include "content/browser/manifest/manifest_manager_host.h" 53 #include "content/browser/manifest/manifest_manager_host.h"
53 #include "content/browser/media/audio_stream_monitor.h" 54 #include "content/browser/media/audio_stream_monitor.h"
54 #include "content/browser/media/capture/web_contents_audio_muter.h" 55 #include "content/browser/media/capture/web_contents_audio_muter.h"
55 #include "content/browser/media/media_web_contents_observer.h" 56 #include "content/browser/media/media_web_contents_observer.h"
56 #include "content/browser/message_port_message_filter.h" 57 #include "content/browser/message_port_message_filter.h"
57 #include "content/browser/plugin_content_origin_whitelist.h" 58 #include "content/browser/plugin_content_origin_whitelist.h"
58 #include "content/browser/renderer_host/render_process_host_impl.h" 59 #include "content/browser/renderer_host/render_process_host_impl.h"
59 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 60 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
60 #include "content/browser/renderer_host/render_view_host_impl.h" 61 #include "content/browser/renderer_host/render_view_host_impl.h"
61 #include "content/browser/renderer_host/render_widget_host_impl.h" 62 #include "content/browser/renderer_host/render_widget_host_impl.h"
62 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" 63 #include "content/browser/renderer_host/render_widget_host_input_event_router.h"
63 #include "content/browser/renderer_host/render_widget_host_view_base.h" 64 #include "content/browser/renderer_host/render_widget_host_view_base.h"
64 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_ impl.h" 65 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_ impl.h"
65 #include "content/browser/site_instance_impl.h" 66 #include "content/browser/site_instance_impl.h"
66 #include "content/browser/wake_lock/wake_lock_service_context.h" 67 #include "content/browser/wake_lock/wake_lock_service_context.h"
67 #include "content/browser/web_contents/web_contents_view_guest.h" 68 #include "content/browser/web_contents/web_contents_view_guest.h"
68 #include "content/browser/webui/generic_handler.h" 69 #include "content/browser/webui/generic_handler.h"
69 #include "content/browser/webui/web_ui_controller_factory_registry.h" 70 #include "content/browser/webui/web_ui_controller_factory_registry.h"
70 #include "content/browser/webui/web_ui_impl.h" 71 #include "content/browser/webui/web_ui_impl.h"
71 #include "content/common/browser_plugin/browser_plugin_constants.h" 72 #include "content/common/browser_plugin/browser_plugin_constants.h"
72 #include "content/common/browser_plugin/browser_plugin_messages.h" 73 #include "content/common/browser_plugin/browser_plugin_messages.h"
73 #include "content/common/frame_messages.h" 74 #include "content/common/frame_messages.h"
74 #include "content/common/input_messages.h" 75 #include "content/common/input_messages.h"
76 #include "content/common/page_messages.h"
75 #include "content/common/site_isolation_policy.h" 77 #include "content/common/site_isolation_policy.h"
76 #include "content/common/ssl_status_serialization.h" 78 #include "content/common/ssl_status_serialization.h"
77 #include "content/common/view_messages.h" 79 #include "content/common/view_messages.h"
78 #include "content/public/browser/ax_event_notification_details.h" 80 #include "content/public/browser/ax_event_notification_details.h"
79 #include "content/public/browser/browser_context.h" 81 #include "content/public/browser/browser_context.h"
80 #include "content/public/browser/browser_plugin_guest_manager.h" 82 #include "content/public/browser/browser_plugin_guest_manager.h"
81 #include "content/public/browser/content_browser_client.h" 83 #include "content/public/browser/content_browser_client.h"
82 #include "content/public/browser/devtools_agent_host.h" 84 #include "content/public/browser/devtools_agent_host.h"
83 #include "content/public/browser/download_manager.h" 85 #include "content/public/browser/download_manager.h"
84 #include "content/public/browser/download_url_parameters.h" 86 #include "content/public/browser/download_url_parameters.h"
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 for (RenderFrameHost* rfh : GetAllFrames()) { 770 for (RenderFrameHost* rfh : GetAllFrames()) {
769 ++number_of_messages; 771 ++number_of_messages;
770 IPC::Message* message_copy = new IPC::Message(*message); 772 IPC::Message* message_copy = new IPC::Message(*message);
771 message_copy->set_routing_id(rfh->GetRoutingID()); 773 message_copy->set_routing_id(rfh->GetRoutingID());
772 rfh->Send(message_copy); 774 rfh->Send(message_copy);
773 } 775 }
774 delete message; 776 delete message;
775 return number_of_messages; 777 return number_of_messages;
776 } 778 }
777 779
780 void WebContentsImpl::SendPageMessage(IPC::Message* msg) {
781 frame_tree_.root()->render_manager()->SendPageMessage(msg);
782 }
783
778 RenderViewHostImpl* WebContentsImpl::GetRenderViewHost() const { 784 RenderViewHostImpl* WebContentsImpl::GetRenderViewHost() const {
779 return GetRenderManager()->current_host(); 785 return GetRenderManager()->current_host();
780 } 786 }
781 787
782 int WebContentsImpl::GetRoutingID() const { 788 int WebContentsImpl::GetRoutingID() const {
783 if (!GetRenderViewHost()) 789 if (!GetRenderViewHost())
784 return MSG_ROUTING_NONE; 790 return MSG_ROUTING_NONE;
785 791
786 return GetRenderViewHost()->GetRoutingID(); 792 return GetRenderViewHost()->GetRoutingID();
787 } 793 }
(...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after
2204 void WebContentsImpl::OnMoveValidationMessage( 2210 void WebContentsImpl::OnMoveValidationMessage(
2205 const gfx::Rect& anchor_in_root_view) { 2211 const gfx::Rect& anchor_in_root_view) {
2206 if (delegate_) 2212 if (delegate_)
2207 delegate_->MoveValidationMessage(this, anchor_in_root_view); 2213 delegate_->MoveValidationMessage(this, anchor_in_root_view);
2208 } 2214 }
2209 2215
2210 void WebContentsImpl::SendScreenRects() { 2216 void WebContentsImpl::SendScreenRects() {
2211 RenderWidgetHostImpl::From(GetRenderViewHost()->GetWidget()) 2217 RenderWidgetHostImpl::From(GetRenderViewHost()->GetWidget())
2212 ->SendScreenRects(); 2218 ->SendScreenRects();
2213 2219
2220 RenderWidgetHostViewBase* rwhv =
2221 static_cast<RenderWidgetHostViewBase*>(GetRenderWidgetHostView());
2222 if (rwhv) {
2223 SendPageMessage(new PageMsg_UpdateWindowScreenRect(
2224 MSG_ROUTING_NONE, rwhv->GetBoundsInRootWindow()));
2225 }
2226
2214 if (browser_plugin_embedder_) 2227 if (browser_plugin_embedder_)
2215 browser_plugin_embedder_->DidSendScreenRects(); 2228 browser_plugin_embedder_->DidSendScreenRects();
2216 } 2229 }
2217 2230
2218 BrowserAccessibilityManager* 2231 BrowserAccessibilityManager*
2219 WebContentsImpl::GetRootBrowserAccessibilityManager() { 2232 WebContentsImpl::GetRootBrowserAccessibilityManager() {
2220 RenderFrameHostImpl* rfh = GetMainFrame(); 2233 RenderFrameHostImpl* rfh = GetMainFrame();
2221 return rfh ? rfh->browser_accessibility_manager() : nullptr; 2234 return rfh ? rfh->browser_accessibility_manager() : nullptr;
2222 } 2235 }
2223 2236
(...skipping 2567 matching lines...) Expand 10 before | Expand all | Expand 10 after
4791 const WebContentsObserver::MediaPlayerId& id) { 4804 const WebContentsObserver::MediaPlayerId& id) {
4792 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); 4805 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id));
4793 } 4806 }
4794 4807
4795 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( 4808 void WebContentsImpl::SetJavaScriptDialogManagerForTesting(
4796 JavaScriptDialogManager* dialog_manager) { 4809 JavaScriptDialogManager* dialog_manager) {
4797 dialog_manager_ = dialog_manager; 4810 dialog_manager_ = dialog_manager;
4798 } 4811 }
4799 4812
4800 } // namespace content 4813 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698