| 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 PointerIdManager_h | |
| 6 #define PointerIdManager_h | |
| 7 | |
| 8 #include "public/platform/WebPointerProperties.h" | |
| 9 #include "wtf/Allocator.h" | |
| 10 #include "wtf/ListHashSet.h" | |
| 11 | |
| 12 namespace blink { | |
| 13 | |
| 14 /** | |
| 15 Helper class for tracking the primary pointer id for each type of PointerEvent
s. | |
| 16 */ | |
| 17 class PointerIdManager { | |
| 18 DISALLOW_NEW(); | |
| 19 public: | |
| 20 PointerIdManager(); | |
| 21 ~PointerIdManager(); | |
| 22 void clear(); | |
| 23 void add(WebPointerProperties::PointerType, unsigned); | |
| 24 void remove(WebPointerProperties::PointerType, unsigned); | |
| 25 bool isPrimary(WebPointerProperties::PointerType, unsigned); | |
| 26 | |
| 27 private: | |
| 28 // TODO(crbug.com/537319): Switch to /one/ set of ids to guarantee uniquenes
s. | |
| 29 ListHashSet<unsigned> m_ids[static_cast<int>(WebPointerProperties::PointerTy
pe::LastEntry) + 1]; | |
| 30 bool m_hasPrimaryId[static_cast<int>(WebPointerProperties::PointerType::Last
Entry) + 1]; | |
| 31 }; | |
| 32 | |
| 33 } // namespace blink | |
| 34 | |
| 35 #endif // PointerIdManager_h | |
| OLD | NEW |