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

Side by Side Diff: Source/core/events/PointerEventUtils.cpp

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 unified diff | Download patch
OLDNEW
(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 #include "config.h"
6 #include "core/events/PointerEventUtils.h"
7
8 namespace blink {
9
10 PointerIdManager::PointerIdManager()
11 {
12 clear();
13 }
14
15 PointerIdManager::~PointerIdManager()
16 {
17 clear();
18 }
19
20 void PointerIdManager::clear()
21 {
22 m_ids.clear();
23 m_hasPrimaryId = false;
24 }
25
26 void PointerIdManager::add(unsigned id)
27 {
28 if (m_ids.isEmpty())
29 m_hasPrimaryId = true;
30 m_ids.add(id);
31 }
32
33 void PointerIdManager::remove(unsigned id)
34 {
35 if (isPrimary(id))
36 m_hasPrimaryId = false;
37 m_ids.remove(id);
38 }
39
40 bool PointerIdManager::isPrimary(unsigned id)
41 {
42 return m_hasPrimaryId && m_ids.first() == id;
43 }
44
45 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698