Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #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.
| |
| 6 #define PointerEventUtils_h | |
| 7 | |
| 8 #include "wtf/ListHashSet.h" | |
| 9 | |
| 10 namespace blink { | |
| 11 | |
| 12 /** | |
| 13 Helps tracking the primary pointer id for PointerEvents. | |
| 14 */ | |
| 15 class PointerIdManager { | |
| 16 public: | |
| 17 PointerIdManager(); | |
| 18 ~PointerIdManager(); | |
| 19 void clear(); | |
| 20 void add(unsigned); | |
| 21 void remove(unsigned); | |
| 22 bool isPrimary(unsigned); | |
| 23 | |
| 24 private: | |
| 25 // TODO(mustaq): Add per-type state when we have support for non-touch Point erEvents. | |
| 26 ListHashSet<unsigned> m_ids; | |
| 27 bool m_hasPrimaryId; | |
| 28 }; | |
| 29 | |
| 30 } // namespace blink | |
| 31 | |
| 32 #endif // PointerEventUtils_h | |
| OLD | NEW |