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

Unified Diff: third_party/WebKit/Source/core/events/PointerIdManager.cpp

Issue 1426643008: Cleaning up PointerIdManager and add id re-mapping (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix EXPECT_EQ compilation error on Android Created 5 years 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
Index: third_party/WebKit/Source/core/events/PointerIdManager.cpp
diff --git a/third_party/WebKit/Source/core/events/PointerIdManager.cpp b/third_party/WebKit/Source/core/events/PointerIdManager.cpp
deleted file mode 100644
index a0342b72387e5550842a64cd8307099dc0d7523b..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/core/events/PointerIdManager.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-// 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.
-
-#include "config.h"
-#include "core/events/PointerIdManager.h"
-
-namespace blink {
-
-namespace {
-
-inline int toInt(WebPointerProperties::PointerType t) { return static_cast<int>(t); }
-
-} // namespace
-
-PointerIdManager::PointerIdManager()
-{
- clear();
-}
-
-PointerIdManager::~PointerIdManager()
-{
- clear();
-}
-
-void PointerIdManager::clear()
-{
- for (int type = 0; type <= toInt(WebPointerProperties::PointerType::LastEntry); type++) {
- m_ids[type].clear();
- m_hasPrimaryId[type] = false;
- }
-}
-
-void PointerIdManager::add(WebPointerProperties::PointerType type, unsigned id)
-{
- if (m_ids[toInt(type)].isEmpty())
- m_hasPrimaryId[toInt(type)] = true;
- m_ids[toInt(type)].add(id);
-}
-
-void PointerIdManager::remove(WebPointerProperties::PointerType type, unsigned id)
-{
- if (isPrimary(type, id)) {
- m_ids[toInt(type)].removeFirst();
- m_hasPrimaryId[toInt(type)] = false;
- } else {
- // Note that simply counting the number of ids instead of storing all of them is not enough.
- // When id is absent, remove() should be a no-op.
- m_ids[toInt(type)].remove(id);
- }
-}
-
-bool PointerIdManager::isPrimary(WebPointerProperties::PointerType type, unsigned id)
-{
- return m_hasPrimaryId[toInt(type)] && m_ids[toInt(type)].first() == id;
-}
-
-} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/events/PointerIdManager.h ('k') | third_party/WebKit/Source/core/input/EventHandler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698