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

Unified Diff: Source/platform/PlatformGestureEvent.h

Issue 850443002: Scroll Customization Prototype (Not for review, WIP) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase / cleanup / minor bug fixes Created 5 years, 10 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/testing/Internals.idl ('k') | Source/web/WebInputEventConversion.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/PlatformGestureEvent.h
diff --git a/Source/platform/PlatformGestureEvent.h b/Source/platform/PlatformGestureEvent.h
index 2b5fb8f66468229be02b403ef5cbd6db565832b1..596cc1c0dec98878cc8f0c051c81af98aeed5dce 100644
--- a/Source/platform/PlatformGestureEvent.h
+++ b/Source/platform/PlatformGestureEvent.h
@@ -43,7 +43,7 @@ public:
memset(&m_data, 0, sizeof(m_data));
}
- PlatformGestureEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, const IntSize& area, double timestamp, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey, float deltaX, float deltaY, float velocityX, float velocityY, bool preventPropagation)
+ PlatformGestureEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, const IntSize& area, double timestamp, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey, float deltaX, float deltaY, float velocityX, float velocityY, bool inertial, bool preventPropagation)
: PlatformEvent(type, shiftKey, ctrlKey, altKey, metaKey, timestamp)
, m_position(position)
, m_globalPosition(globalPosition)
@@ -53,11 +53,12 @@ public:
if (type == PlatformEvent::GestureScrollBegin
|| type == PlatformEvent::GestureScrollEnd
|| type == PlatformEvent::GestureScrollUpdate) {
- m_data.m_scrollUpdate.m_deltaX = deltaX;
- m_data.m_scrollUpdate.m_deltaY = deltaY;
- m_data.m_scrollUpdate.m_velocityX = velocityX;
- m_data.m_scrollUpdate.m_velocityY = velocityY;
- m_data.m_scrollUpdate.m_preventPropagation = preventPropagation;
+ m_data.m_scroll.m_deltaX = deltaX;
+ m_data.m_scroll.m_deltaY = deltaY;
+ m_data.m_scroll.m_velocityX = velocityX;
+ m_data.m_scroll.m_velocityY = velocityY;
+ m_data.m_scroll.m_inertial = inertial;
+ m_data.m_scroll.m_preventPropagation = preventPropagation;
}
}
@@ -68,14 +69,16 @@ public:
float deltaX() const
{
- ASSERT(m_type == PlatformEvent::GestureScrollUpdate);
- return m_data.m_scrollUpdate.m_deltaX;
+ ASSERT(m_type == PlatformEvent::GestureScrollUpdate
+ || m_type == PlatformEvent::GestureScrollEnd);
+ return m_data.m_scroll.m_deltaX;
}
float deltaY() const
{
- ASSERT(m_type == PlatformEvent::GestureScrollUpdate);
- return m_data.m_scrollUpdate.m_deltaY;
+ ASSERT(m_type == PlatformEvent::GestureScrollUpdate
+ || m_type == PlatformEvent::GestureScrollEnd);
+ return m_data.m_scroll.m_deltaY;
}
int tapCount() const
@@ -86,20 +89,29 @@ public:
float velocityX() const
{
- ASSERT(m_type == PlatformEvent::GestureScrollUpdate);
- return m_data.m_scrollUpdate.m_velocityX;
+ ASSERT(m_type == PlatformEvent::GestureScrollUpdate
+ || m_type == PlatformEvent::GestureScrollEnd);
+ return m_data.m_scroll.m_velocityX;
}
float velocityY() const
{
- ASSERT(m_type == PlatformEvent::GestureScrollUpdate);
- return m_data.m_scrollUpdate.m_velocityY;
+ ASSERT(m_type == PlatformEvent::GestureScrollUpdate
+ || m_type == PlatformEvent::GestureScrollEnd);
+ return m_data.m_scroll.m_velocityY;
+ }
+
+ bool inertial() const
+ {
+ ASSERT(m_type == PlatformEvent::GestureScrollUpdate
+ || m_type == PlatformEvent::GestureScrollEnd);
+ return m_data.m_scroll.m_inertial;
}
bool preventPropagation() const
{
ASSERT(m_type == PlatformEvent::GestureScrollUpdate);
- return m_data.m_scrollUpdate.m_preventPropagation;
+ return m_data.m_scroll.m_preventPropagation;
}
float scale() const
@@ -160,7 +172,8 @@ protected:
float m_velocityX;
float m_velocityY;
int m_preventPropagation;
- } m_scrollUpdate;
+ bool m_inertial;
+ } m_scroll;
struct {
float m_scale;
« no previous file with comments | « Source/core/testing/Internals.idl ('k') | Source/web/WebInputEventConversion.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698