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

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

Issue 15725009: Should be able to scroll text in <input> fields with touch (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Cleanup from initial CR Created 7 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 | « Source/core/platform/ScrollableArea.h ('k') | Source/core/rendering/RenderBox.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/ScrollableArea.cpp
diff --git a/Source/core/platform/ScrollableArea.cpp b/Source/core/platform/ScrollableArea.cpp
index 0f02cf04bc2b3ff3a325ea00e11de5e29b5a5752..e9b61b322938f98a72470364ee7ed115be568800 100644
--- a/Source/core/platform/ScrollableArea.cpp
+++ b/Source/core/platform/ScrollableArea.cpp
@@ -82,6 +82,21 @@ void ScrollableArea::setScrollOrigin(const IntPoint& origin)
}
}
+bool ScrollableArea::touchScroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
+{
+ // For a touch scroll, we don't need the scrollbars to exist (i.e. for an input text field)
+ ScrollbarOrientation orientation;
+ if (direction == ScrollUp || direction == ScrollDown)
+ orientation = VerticalScrollbar;
+ else
+ orientation = HorizontalScrollbar;
+
+ if (direction == ScrollUp || direction == ScrollLeft)
+ multiplier = -multiplier;
+
+ return scrollAnimator()->scroll(orientation, granularity, 1.0f, multiplier);
+}
+
bool ScrollableArea::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
{
ScrollbarOrientation orientation;
« no previous file with comments | « Source/core/platform/ScrollableArea.h ('k') | Source/core/rendering/RenderBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698