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

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

Issue 2290233007: Move convertViewportToWindow and convertWindowToViewport from (Closed)
Patch Set: add client to WebSharedWorkerImpl Created 4 years, 3 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: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
index fb47bcb35367065b311f3047fb28efdee9ad1c33..58eb3cb98edde32d6328bec49af3134370db8cf8 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
@@ -59,11 +59,11 @@ struct SameSizeAsScrollableArea {
static_assert(sizeof(ScrollableArea) == sizeof(SameSizeAsScrollableArea), "ScrollableArea should stay small");
-int ScrollableArea::pixelsPerLineStep(HostWindow* host)
+int ScrollableArea::pixelsPerLineStep(HostWindow* host, Widget* widget)
{
if (!host)
return kPixelsPerLineStep;
- return host->windowToViewportScalar(kPixelsPerLineStep);
+ return host->windowToViewportScalar(*widget, kPixelsPerLineStep);
}
float ScrollableArea::minFractionToStepWhenPaging()
@@ -134,7 +134,7 @@ ScrollbarOrientation ScrollableArea::scrollbarOrientationFromDirection(ScrollDir
return (direction == ScrollUp || direction == ScrollDown) ? VerticalScrollbar : HorizontalScrollbar;
}
-float ScrollableArea::scrollStep(ScrollGranularity granularity, ScrollbarOrientation orientation) const
+float ScrollableArea::scrollStep(ScrollGranularity granularity, ScrollbarOrientation orientation)
{
switch (granularity) {
case ScrollByLine:
@@ -567,9 +567,9 @@ DoublePoint ScrollableArea::clampScrollPosition(const DoublePoint& scrollPositio
return scrollPosition.shrunkTo(maximumScrollPositionDouble()).expandedTo(minimumScrollPositionDouble());
}
-int ScrollableArea::lineStep(ScrollbarOrientation) const
+int ScrollableArea::lineStep(ScrollbarOrientation)
{
- return pixelsPerLineStep(getHostWindow());
+ return pixelsPerLineStep(getHostWindow(), getWidget());
}
int ScrollableArea::pageStep(ScrollbarOrientation orientation) const
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollableArea.h ('k') | third_party/WebKit/Source/platform/scroll/Scrollbar.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698