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

Unified Diff: third_party/WebKit/public/platform/WebPointerEvent.h

Issue 2860663006: Remove WebTouchEvent from TouchEventManager APIs (Closed)
Patch Set: Add TODO for clarification of the fields Created 3 years, 6 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/public/platform/WebPointerEvent.h
diff --git a/third_party/WebKit/public/platform/WebPointerEvent.h b/third_party/WebKit/public/platform/WebPointerEvent.h
new file mode 100644
index 0000000000000000000000000000000000000000..ef0606197dea30d59862ad7b1b395cc847b01e68
--- /dev/null
+++ b/third_party/WebKit/public/platform/WebPointerEvent.h
@@ -0,0 +1,66 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WebPointerEvent_h
+#define WebPointerEvent_h
+
+#include "WebInputEvent.h"
+#include "WebPointerProperties.h"
+#include "WebTouchEvent.h"
+
+namespace blink {
+
+// See WebInputEvent.h for details why this pack is here.
+#pragma pack(push, 4)
+
+// WebPointerEvent
+// This is a WIP and currently used only in Blink and only for touch.
+// TODO(nzolghadr): We should unify the fields in this class into
+// WebPointerProperties and not have pointertype specific attributes here.
+// --------------------------------------------------------------
+
+class WebPointerEvent : public WebInputEvent, public WebPointerProperties {
+ public:
+ WebPointerEvent()
+ : WebInputEvent(sizeof(WebPointerEvent)), WebPointerProperties(0) {}
+ BLINK_PLATFORM_EXPORT WebPointerEvent(const WebTouchEvent&,
+ const WebTouchPoint&);
+
+ // TODO(crbug.com/736014): We need a clarified definition of the scale and
+ // the coordinate space on these attributes.
+ float width;
+ float height;
+
+ // ------------ Touch Point Specific ------------
+
+ float rotation_angle;
+
+ // ------------ Touch Event Specific ------------
+
+ // Whether the event is blocking, non-blocking, all event
+ // listeners were passive or was forced to be non-blocking.
+ DispatchType dispatch_type;
+
+ // For a single touch, this is true after the touch-point has moved beyond
+ // the platform slop region. For a multitouch, this is true after any
+ // touch-point has moved (by whatever amount).
+ bool moved_beyond_slop_region;
+
+ // Whether this touch event is a touchstart or a first touchmove event per
+ // scroll.
+ bool touch_start_or_first_touch_move;
+
+#if INSIDE_BLINK
+ bool IsCancelable() const { return dispatch_type == kBlocking; }
+
+ BLINK_PLATFORM_EXPORT WebPointerEvent WebPointerEventInRootFrame() const;
+
+#endif
+};
+
+#pragma pack(pop)
+
+} // namespace blink
+
+#endif // WebMouseEvent_h

Powered by Google App Engine
This is Rietveld 408576698