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/LocalFrame.cpp

Issue 1557993002: Add scroll units in GestureEvents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix layout test on Mac Created 4 years, 11 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/core/frame/LocalFrame.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
index eca2f188fe6f8acee6e9ae4fb8fdd189606af2ad..900be2856592ddbd2a098beb70384a235e416917 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -775,15 +775,15 @@ void LocalFrame::removeSpellingMarkersUnderWords(const Vector<String>& words)
spellChecker().removeSpellingMarkersUnderWords(words);
}
-static ScrollResult scrollAreaOnBothAxes(const FloatSize& delta, ScrollableArea& view)
+static ScrollResult scrollAreaOnBothAxes(ScrollGranularity granularity, const FloatSize& delta, ScrollableArea& view)
{
- ScrollResultOneDimensional scrolledHorizontal = view.userScroll(ScrollLeft, ScrollByPrecisePixel, delta.width());
- ScrollResultOneDimensional scrolledVertical = view.userScroll(ScrollUp, ScrollByPrecisePixel, delta.height());
+ ScrollResultOneDimensional scrolledHorizontal = view.userScroll(ScrollLeft, granularity, delta.width());
+ ScrollResultOneDimensional scrolledVertical = view.userScroll(ScrollUp, granularity, delta.height());
return ScrollResult(scrolledHorizontal.didScroll, scrolledVertical.didScroll, scrolledHorizontal.unusedScrollDelta, scrolledVertical.unusedScrollDelta);
}
// Returns true if a scroll occurred.
-ScrollResult LocalFrame::applyScrollDelta(const FloatSize& delta, bool isScrollBegin)
+ScrollResult LocalFrame::applyScrollDelta(ScrollGranularity granularity, const FloatSize& delta, bool isScrollBegin)
{
if (isScrollBegin)
host()->topControls().scrollBegin();
@@ -800,7 +800,7 @@ ScrollResult LocalFrame::applyScrollDelta(const FloatSize& delta, bool isScrollB
if (remainingDelta.isZero())
return ScrollResult(delta.width(), delta.height(), 0.0f, 0.0f);
- ScrollResult result = scrollAreaOnBothAxes(remainingDelta, *view()->scrollableArea());
+ ScrollResult result = scrollAreaOnBothAxes(granularity, remainingDelta, *view()->scrollableArea());
result.didScrollX = result.didScrollX || (remainingDelta.width() != delta.width());
result.didScrollY = result.didScrollY || (remainingDelta.height() != delta.height());
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.h ('k') | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698