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

Unified Diff: Source/platform/scroll/ScrollableArea.cpp

Issue 199253002: Made PinchViewport a ScrollableArea (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 | « Source/platform/scroll/ScrollableArea.h ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scroll/ScrollableArea.cpp
diff --git a/Source/platform/scroll/ScrollableArea.cpp b/Source/platform/scroll/ScrollableArea.cpp
index 6c202a8dbb4331bf472e1c682f3ab5ea2def1f0f..52081fd9037eebfe6f8347af955e4eb9423dd279 100644
--- a/Source/platform/scroll/ScrollableArea.cpp
+++ b/Source/platform/scroll/ScrollableArea.cpp
@@ -422,6 +422,15 @@ int ScrollableArea::lineStep(ScrollbarOrientation) const
return pixelsPerLineStep();
}
+int ScrollableArea::pageStep(ScrollbarOrientation orientation) const
+{
+ int length = (orientation == HorizontalScrollbar) ? visibleWidth() : visibleHeight();
+ int minPageStep = static_cast<float>(length) * minFractionToStepWhenPaging();
+ int pageStep = std::max(minPageStep, length - maxOverlapBetweenPages());
+
+ return std::max(pageStep, 1);
+}
+
int ScrollableArea::documentStep(ScrollbarOrientation orientation) const
{
return scrollSize(orientation);
« no previous file with comments | « Source/platform/scroll/ScrollableArea.h ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698