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

Unified Diff: content/browser/frame_host/cross_process_frame_connector.cc

Issue 132383005: Set correct viewport size for an out of process iframe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed obsolete test Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
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_;
}
« no previous file with comments | « content/browser/frame_host/cross_process_frame_connector.h ('k') | content/browser/frame_host/render_frame_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698