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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 1721883003: Put Top Control resizing change behind a flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ...and update tests to use the flag Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index ae4738f4f19290b94380f0d41a2578d929600abb..ec6924c196278b29ad2b80b412b5e0523dacaa15 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -1137,6 +1137,20 @@ IntRect FrameView::computeVisibleArea()
FloatSize FrameView::viewportSizeForViewportUnits() const
{
+ float zoom = frame().pageZoomFactor();
+
+ if (m_frame->settings() && !RuntimeEnabledFeatures::inertTopControlsEnabled()) {
+ FloatSize viewportSize;
+
+ LayoutView* layoutView = this->layoutView();
+ if (!layoutView)
+ return viewportSize;
+
+ viewportSize.setWidth(layoutView->viewWidth(IncludeScrollbars) / zoom);
+ viewportSize.setHeight(layoutView->viewHeight(IncludeScrollbars) / zoom);
+ return viewportSize;
+ }
+
FloatSize size(layoutSize(IncludeScrollbars));
// We use the layoutSize rather than frameRect to calculate viewport units
@@ -1153,8 +1167,7 @@ FloatSize FrameView::viewportSizeForViewportUnits() const
size.expand(0, topControls.height() / pageScaleAtLayoutWidth);
}
- float scale = frame().pageZoomFactor();
- size.scale(1 / scale);
+ size.scale(1 / zoom);
return size;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698