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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollTypes.h

Issue 2539283002: Remove PlatformGestureEvent in favour of using WebGestureEvent (Closed)
Patch Set: Add missing copyright on new file Created 4 years 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/ScrollTypes.h
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollTypes.h b/third_party/WebKit/Source/platform/scroll/ScrollTypes.h
index 32f9ff2de0afa1bb19faec67be084cea8067ffb6..32d22c8071fd1e62bd29df498131f24396e2de42 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollTypes.h
+++ b/third_party/WebKit/Source/platform/scroll/ScrollTypes.h
@@ -27,6 +27,7 @@
#define ScrollTypes_h
#include "platform/geometry/FloatPoint.h"
+#include "public/platform/WebGestureEvent.h"
#include "wtf/Assertions.h"
namespace blink {
@@ -249,6 +250,21 @@ inline ScrollOffset toScrollDelta(ScrollDirectionPhysical dir, float delta) {
: ScrollOffset(0, delta);
}
+inline ScrollGranularity toPlatformScrollGranularity(
+ WebGestureEvent::ScrollUnits units) {
+ switch (units) {
+ case WebGestureEvent::ScrollUnits::PrecisePixels:
+ return ScrollGranularity::ScrollByPrecisePixel;
+ case WebGestureEvent::ScrollUnits::Pixels:
+ return ScrollGranularity::ScrollByPixel;
+ case WebGestureEvent::ScrollUnits::Page:
+ return ScrollGranularity::ScrollByPage;
+ default:
+ NOTREACHED();
+ return ScrollGranularity::ScrollByPrecisePixel;
+ }
+}
+
typedef unsigned ScrollbarControlPartMask;
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm ('k') | third_party/WebKit/Source/platform/scroll/Scrollbar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698