Chromium Code Reviews| 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 |