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

Unified Diff: Source/core/events/PointerEventUtils.h

Issue 1144313003: Added PointerEvent firing on touch events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed primary pointer id on reuse. Created 5 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
« no previous file with comments | « Source/core/events/PointerEvent.cpp ('k') | Source/core/events/PointerEventUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/events/PointerEventUtils.h
diff --git a/Source/core/events/PointerEventUtils.h b/Source/core/events/PointerEventUtils.h
new file mode 100644
index 0000000000000000000000000000000000000000..2ee039b87b5c8367480faf3ade410b8435ea8bb5
--- /dev/null
+++ b/Source/core/events/PointerEventUtils.h
@@ -0,0 +1,32 @@
+// Copyright 2015 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 PointerEventUtils_h
Rick Byers 2015/06/16 17:25:38 Do you have plans to add other "utils" here? Usua
mustaq 2015/06/16 20:18:42 Done.
+#define PointerEventUtils_h
+
+#include "wtf/ListHashSet.h"
+
+namespace blink {
+
+/**
+ Helps tracking the primary pointer id for PointerEvents.
+*/
+class PointerIdManager {
+public:
+ PointerIdManager();
+ ~PointerIdManager();
+ void clear();
+ void add(unsigned);
+ void remove(unsigned);
+ bool isPrimary(unsigned);
+
+private:
+ // TODO(mustaq): Add per-type state when we have support for non-touch PointerEvents.
+ ListHashSet<unsigned> m_ids;
+ bool m_hasPrimaryId;
+};
+
+} // namespace blink
+
+#endif // PointerEventUtils_h
« no previous file with comments | « Source/core/events/PointerEvent.cpp ('k') | Source/core/events/PointerEventUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698