| 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 520eeb60fff67026a7a19304301accd9be4faf67..7eec85dd9901f47674fe4250c208d02bad0450d9 100644
|
| --- a/content/browser/frame_host/cross_process_frame_connector.cc
|
| +++ b/content/browser/frame_host/cross_process_frame_connector.cc
|
| @@ -15,7 +15,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);
|
| }
|
|
|
| @@ -34,6 +35,8 @@ bool CrossProcessFrameConnector::OnMessageReceived(const IPC::Message& msg) {
|
| OnCompositorFrameSwappedACK)
|
| IPC_MESSAGE_HANDLER(FrameHostMsg_ReclaimCompositorResources,
|
| OnReclaimCompositorResources)
|
| + IPC_MESSAGE_HANDLER(FrameHostMsg_InitializeChildFrame,
|
| + OnInitializeChildFrame)
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| IPC_END_MESSAGE_MAP_EX()
|
|
|
| @@ -116,6 +119,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_;
|
| }
|
|
|