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

Unified Diff: third_party/WebKit/Source/core/events/EventUtil.h

Issue 1934413003: Usecounter added for counting usage of addEventListener for PointerEvents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: third_party/WebKit/Source/core/events/EventUtil.h
diff --git a/third_party/WebKit/Source/core/events/EventUtil.h b/third_party/WebKit/Source/core/events/EventUtil.h
new file mode 100644
index 0000000000000000000000000000000000000000..df8928b092fe23c3a230c282b38319152fc1af29
--- /dev/null
+++ b/third_party/WebKit/Source/core/events/EventUtil.h
@@ -0,0 +1,35 @@
+// Copyright 2016 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 EventUtil_h
+#define EventUtil_h
+
+#include "core/EventTypeNames.h"
+
+namespace blink {
+
+class EventUtil {
bokan 2016/05/10 22:52:02 If this is just going to be a collection of functi
sahel 2016/05/11 21:15:02 I changed the class to the namespace. I had the im
bokan 2016/05/11 21:19:59 Yah, that's fine, it's not in a hot code path.
+
+public:
+ static inline bool isPointerEventType(const AtomicString& eventType)
+ {
+ return eventType == EventTypeNames::gotpointercapture
+ || eventType == EventTypeNames::lostpointercapture
+ || eventType == EventTypeNames::pointercancel
+ || eventType == EventTypeNames::pointerdown
+ || eventType == EventTypeNames::pointerenter
+ || eventType == EventTypeNames::pointerleave
+ || eventType == EventTypeNames::pointermove
+ || eventType == EventTypeNames::pointerout
+ || eventType == EventTypeNames::pointerover
+ || eventType == EventTypeNames::pointerup;
+ }
+
+private:
+ EventUtil() {};
+};
+
+} // namespace blink
+
+#endif // EventUtil_h

Powered by Google App Engine
This is Rietveld 408576698