Index: content/browser/frame_host/cross_process_frame_connector.cc |
diff --git a/content/browser/frame_host/cross_process_frame_connector.cc b/content/browser/frame_host/cross_process_frame_connector.cc |
index 0378181953e77093f8bcac8bf3be44c15fa60cd7..19fcdf0d4b07713fe2cabee147f26ad574deec00 100644 |
--- a/content/browser/frame_host/cross_process_frame_connector.cc |
+++ b/content/browser/frame_host/cross_process_frame_connector.cc |
@@ -17,7 +17,8 @@ namespace content { |
CrossProcessFrameConnector::CrossProcessFrameConnector( |
RenderFrameHostImpl* frame_proxy_in_parent_renderer) |
: frame_proxy_in_parent_renderer_(frame_proxy_in_parent_renderer), |
- view_(NULL) { |
+ view_(NULL), |
+ device_scale_factor_(1) { |
frame_proxy_in_parent_renderer->set_cross_process_frame_connector(this); |
} |
@@ -37,6 +38,8 @@ bool CrossProcessFrameConnector::OnMessageReceived(const IPC::Message& msg) { |
IPC_MESSAGE_HANDLER(FrameHostMsg_ReclaimCompositorResources, |
OnReclaimCompositorResources) |
IPC_MESSAGE_HANDLER(FrameHostMsg_ForwardInputEvent, OnForwardInputEvent) |
+ IPC_MESSAGE_HANDLER(FrameHostMsg_InitializeChildFrame, |
+ OnInitializeChildFrame) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP_EX() |
@@ -119,6 +122,24 @@ void CrossProcessFrameConnector::OnReclaimCompositorResources( |
params.ack); |
} |
+void CrossProcessFrameConnector::OnInitializeChildFrame(gfx::Rect frame_rect, |
+ float scale_factor) { |
+ if (scale_factor != device_scale_factor_) { |
+ device_scale_factor_ = scale_factor; |
+ if (view_) { |
+ RenderWidgetHostImpl* child_widget = |
+ RenderWidgetHostImpl::From(view_->GetRenderWidgetHost()); |
+ child_widget->NotifyScreenInfoChanged(); |
+ } |
+ } |
+ |
+ if (!frame_rect.size().IsEmpty()) { |
+ child_frame_rect_ = frame_rect; |
+ if (view_) |
+ view_->SetSize(frame_rect.size()); |
+ } |
+} |
+ |
gfx::Rect CrossProcessFrameConnector::ChildFrameRect() { |
return child_frame_rect_; |
} |