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

Side by Side Diff: content/browser/frame_host/cross_process_frame_connector.cc

Issue 2122023002: Cross-process frames should be notified of device scale factor changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix RenderWidgetHostTest.ResizeScreenInfo. Created 4 years, 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/frame_host/cross_process_frame_connector.h" 5 #include "content/browser/frame_host/cross_process_frame_connector.h"
6 6
7 #include "cc/surfaces/surface.h" 7 #include "cc/surfaces/surface.h"
8 #include "cc/surfaces/surface_manager.h" 8 #include "cc/surfaces/surface_manager.h"
9 #include "content/browser/compositor/surface_utils.h" 9 #include "content/browser/compositor/surface_utils.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 void CrossProcessFrameConnector::OnInitializeChildFrame(float scale_factor) { 115 void CrossProcessFrameConnector::OnInitializeChildFrame(float scale_factor) {
116 if (scale_factor != device_scale_factor_) 116 if (scale_factor != device_scale_factor_)
117 SetDeviceScaleFactor(scale_factor); 117 SetDeviceScaleFactor(scale_factor);
118 } 118 }
119 119
120 gfx::Rect CrossProcessFrameConnector::ChildFrameRect() { 120 gfx::Rect CrossProcessFrameConnector::ChildFrameRect() {
121 return child_frame_rect_; 121 return child_frame_rect_;
122 } 122 }
123 123
124 void CrossProcessFrameConnector::GetScreenInfo(blink::WebScreenInfo* results) {
125 auto* parent_view = GetParentRenderWidgetHostView();
126 if (parent_view) {
127 parent_view->GetScreenInfo(results);
128 }
129 }
130
131 void CrossProcessFrameConnector::UpdateCursor(const WebCursor& cursor) { 124 void CrossProcessFrameConnector::UpdateCursor(const WebCursor& cursor) {
132 RenderWidgetHostViewBase* root_view = GetRootRenderWidgetHostView(); 125 RenderWidgetHostViewBase* root_view = GetRootRenderWidgetHostView();
133 if (root_view) 126 if (root_view)
134 root_view->UpdateCursor(cursor); 127 root_view->UpdateCursor(cursor);
135 } 128 }
136 129
137 gfx::Point CrossProcessFrameConnector::TransformPointToRootCoordSpace( 130 gfx::Point CrossProcessFrameConnector::TransformPointToRootCoordSpace(
138 const gfx::Point& point, 131 const gfx::Point& point,
139 cc::SurfaceId surface_id) { 132 cc::SurfaceId surface_id) {
140 gfx::Point transformed_point = point; 133 gfx::Point transformed_point = point;
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 343
351 if (parent) { 344 if (parent) {
352 return static_cast<RenderWidgetHostViewBase*>( 345 return static_cast<RenderWidgetHostViewBase*>(
353 parent->current_frame_host()->GetView()); 346 parent->current_frame_host()->GetView());
354 } 347 }
355 348
356 return nullptr; 349 return nullptr;
357 } 350 }
358 351
359 } // namespace content 352 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698