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

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

Issue 1144313003: Added PointerEvent firing on touch events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased. TODO fixes. 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/PointerIdManager.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/events/PointerIdManager.h
diff --git a/Source/core/events/PointerIdManager.h b/Source/core/events/PointerIdManager.h
new file mode 100644
index 0000000000000000000000000000000000000000..de0462b891d72faecb09e888e14260b3ff12343b
--- /dev/null
+++ b/Source/core/events/PointerIdManager.h
@@ -0,0 +1,40 @@
+// 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 PointerIdManager_h
+#define PointerIdManager_h
+
+#include "wtf/ListHashSet.h"
+
+namespace blink {
+
+/**
+ Helper class for tracking the primary pointer id for each type of PointerEvents.
+*/
+class PointerIdManager {
+public:
+ // TODO(mustaq): Move this enum to PointerEvent.h? Change the spec to use enums?
+ enum PointerType {
+ PointerTypeUnknown = 0,
+ PointerTypeMouse,
+ PointerTypePen,
+ PointerTypeTouch,
+ PointerTypeLastEntry // Must be the last entry in the list
+ };
+
+ PointerIdManager();
+ ~PointerIdManager();
+ void clear();
+ void add(PointerType, unsigned);
+ void remove(PointerType, unsigned);
+ bool isPrimary(PointerType, unsigned);
+
+private:
+ ListHashSet<unsigned> m_ids[PointerTypeLastEntry];
+ bool m_hasPrimaryId[PointerTypeLastEntry];
+};
+
+} // namespace blink
+
+#endif // PointerIdManager_h
« no previous file with comments | « Source/core/events/PointerEvent.cpp ('k') | Source/core/events/PointerIdManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698