| 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 19fcdf0d4b07713fe2cabee147f26ad574deec00..0dc101bf5496046e95b85ceeacb28c4eb8b57377 100644
|
| --- a/content/browser/frame_host/cross_process_frame_connector.cc
|
| +++ b/content/browser/frame_host/cross_process_frame_connector.cc
|
| @@ -54,9 +54,12 @@ void CrossProcessFrameConnector::set_view(
|
|
|
| view_ = view;
|
|
|
| - // Attach ourselves to the new view.
|
| - if (view_)
|
| + // Attach ourselves to the new view and size it appropriately.
|
| + if (view_) {
|
| view_->set_cross_process_frame_connector(this);
|
| + SetDeveiceScaleFactor(device_scale_factor_);
|
| + SetSize(child_frame_rect_);
|
| + }
|
| }
|
|
|
| void CrossProcessFrameConnector::RenderProcessGone() {
|
| @@ -124,20 +127,11 @@ void CrossProcessFrameConnector::OnReclaimCompositorResources(
|
|
|
| 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 (scale_factor != device_scale_factor_)
|
| + SetDeveiceScaleFactor(scale_factor);
|
|
|
| - if (!frame_rect.size().IsEmpty()) {
|
| - child_frame_rect_ = frame_rect;
|
| - if (view_)
|
| - view_->SetSize(frame_rect.size());
|
| - }
|
| + if (!frame_rect.size().IsEmpty())
|
| + SetSize(frame_rect);
|
| }
|
|
|
| gfx::Rect CrossProcessFrameConnector::ChildFrameRect() {
|
| @@ -176,4 +170,19 @@ void CrossProcessFrameConnector::OnForwardInputEvent(
|
| }
|
| }
|
|
|
| +void CrossProcessFrameConnector::SetDeveiceScaleFactor(float scale_factor) {
|
| + device_scale_factor_ = scale_factor;
|
| + if (view_) {
|
| + RenderWidgetHostImpl* child_widget =
|
| + RenderWidgetHostImpl::From(view_->GetRenderWidgetHost());
|
| + child_widget->NotifyScreenInfoChanged();
|
| + }
|
| +}
|
| +
|
| +void CrossProcessFrameConnector::SetSize(gfx::Rect frame_rect) {
|
| + child_frame_rect_ = frame_rect;
|
| + if (view_)
|
| + view_->SetSize(frame_rect.size());
|
| +}
|
| +
|
| } // namespace content
|
|
|