Chromium Code Reviews| Index: content/browser/web_contents/web_contents_impl.cc |
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
| index 6f1e50ea03c47a3f6e877e865240e570b5f30c39..df3414217cab5d788641094fdacbdeed2f3ccbc0 100644 |
| --- a/content/browser/web_contents/web_contents_impl.cc |
| +++ b/content/browser/web_contents/web_contents_impl.cc |
| @@ -45,6 +45,7 @@ |
| #include "content/browser/frame_host/navigation_handle_impl.h" |
| #include "content/browser/frame_host/navigator_impl.h" |
| #include "content/browser/frame_host/render_frame_host_impl.h" |
| +#include "content/browser/frame_host/render_frame_proxy_host.h" |
| #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
| #include "content/browser/geolocation/geolocation_service_context.h" |
| #include "content/browser/host_zoom_map_impl.h" |
| @@ -72,6 +73,7 @@ |
| #include "content/common/browser_plugin/browser_plugin_messages.h" |
| #include "content/common/frame_messages.h" |
| #include "content/common/input_messages.h" |
| +#include "content/common/page_messages.h" |
| #include "content/common/site_isolation_policy.h" |
| #include "content/common/ssl_status_serialization.h" |
| #include "content/common/view_messages.h" |
| @@ -790,6 +792,27 @@ int WebContentsImpl::SendToAllFrames(IPC::Message* message) { |
| return number_of_messages; |
| } |
| +int WebContentsImpl::SendToAllViews(IPC::Message* msg) { |
|
nasko
2016/02/11 18:21:28
Sending to all "Views" sounds like the wrong abstr
lfg
2016/02/11 20:26:09
Done.
|
| + DCHECK(IPC_MESSAGE_CLASS(*msg) == PageMsgStart); |
| + const auto& proxies = |
| + frame_tree_.root()->render_manager()->GetAllProxyHosts(); |
|
nasko
2016/02/11 18:21:28
I'd avoid exposing the proxies from RFHM. This met
lfg
2016/02/11 20:26:09
Done.
|
| + |
| + for (const auto& pair : proxies) { |
| + RenderFrameProxyHost* proxy = pair.second.get(); |
| + |
| + IPC::Message* copy = new IPC::Message(*msg); |
| + copy->set_routing_id(proxy->GetRoutingID()); |
| + proxy->Send(copy); |
| + } |
| + |
| + RenderFrameHost* frame_host = |
| + frame_tree_.root()->render_manager()->current_frame_host(); |
|
nasko
2016/02/11 18:21:28
If we have a pending/speculative RFH, shouldn't we
lfg
2016/02/11 20:26:08
Yes, we should, because if/when we commit, we need
|
| + msg->set_routing_id(frame_host->GetRoutingID()); |
| + frame_host->Send(msg); |
| + |
| + return 1 + proxies.size(); |
| +} |
| + |
| RenderViewHostImpl* WebContentsImpl::GetRenderViewHost() const { |
| return GetRenderManager()->current_host(); |
| } |
| @@ -2217,6 +2240,13 @@ void WebContentsImpl::SendScreenRects() { |
| RenderWidgetHostImpl::From(GetRenderViewHost()->GetWidget()) |
| ->SendScreenRects(); |
| + RenderWidgetHostViewBase* rwhv = |
| + static_cast<RenderWidgetHostViewBase*>(GetRenderWidgetHostView()); |
| + if (rwhv) { |
| + SendToAllViews(new PageMsg_UpdateWindowScreenRect( |
| + MSG_ROUTING_NONE, rwhv->GetBoundsInRootWindow())); |
| + } |
| + |
| if (browser_plugin_embedder_) |
| browser_plugin_embedder_->DidSendScreenRects(); |
| } |