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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2914013004: Propagate auto-resize viewport values to OOPIF processes (Closed)
Patch Set: Style tidy-up Created 3 years, 7 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
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index ed882eff1d6c293bf29985766f4031d368b948c8..8e05967c9dd1beb77230dd71bd8d32b75c5a304b 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2786,10 +2786,32 @@ void WebContentsImpl::ResizeDueToAutoResize(
if (render_widget_host != GetRenderViewHost()->GetWidget())
return;
+ auto_resize_size_ = new_size;
+
+ // Out-of-process iframe visible viewport sizes usually come from the
+ // top-level RenderWidgetHostView, but when auto-resize is enabled on the
+ // top frame then that size is used instead.
+ for (FrameTreeNode* node : frame_tree_.Nodes()) {
+ if (node->current_frame_host()->is_local_root()) {
+ RenderWidgetHostImpl* host =
+ node->current_frame_host()->GetRenderWidgetHost();
+ if (host != render_widget_host)
+ host->WasResized();
+ }
+ }
+
if (delegate_)
delegate_->ResizeDueToAutoResize(this, new_size);
}
+gfx::Size WebContentsImpl::GetAutoResizeSize() {
+ return auto_resize_size_;
+}
+
+void WebContentsImpl::ResetAutoResizeSize() {
+ auto_resize_size_ = gfx::Size();
+}
+
WebContents* WebContentsImpl::OpenURL(const OpenURLParams& params) {
if (!delegate_)
return NULL;
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698