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

Unified Diff: content/common/input/web_touch_event_traits.cc

Issue 1560553002: Framelet Prototype 2016 Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased + Applied Brett's Windows + Fixed security issue Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/input/web_touch_event_traits.h ('k') | content/content_common.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/input/web_touch_event_traits.cc
diff --git a/content/common/input/web_touch_event_traits.cc b/content/common/input/web_touch_event_traits.cc
deleted file mode 100644
index 175bf78ef41d8eb20457b8e874ec195845be86fb..0000000000000000000000000000000000000000
--- a/content/common/input/web_touch_event_traits.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2014 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 "content/common/input/web_touch_event_traits.h"
-
-#include <stddef.h>
-
-#include "base/logging.h"
-
-using blink::WebInputEvent;
-using blink::WebTouchEvent;
-using blink::WebTouchPoint;
-
-namespace content {
-
-bool WebTouchEventTraits::AllTouchPointsHaveState(
- const WebTouchEvent& event,
- blink::WebTouchPoint::State state) {
- if (!event.touchesLength)
- return false;
- for (size_t i = 0; i < event.touchesLength; ++i) {
- if (event.touches[i].state != state)
- return false;
- }
- return true;
-}
-
-bool WebTouchEventTraits::IsTouchSequenceStart(const WebTouchEvent& event) {
- DCHECK(event.touchesLength);
- if (event.type != WebInputEvent::TouchStart)
- return false;
- return AllTouchPointsHaveState(event, blink::WebTouchPoint::StatePressed);
-}
-
-bool WebTouchEventTraits::IsTouchSequenceEnd(const WebTouchEvent& event) {
- if (event.type != WebInputEvent::TouchEnd &&
- event.type != WebInputEvent::TouchCancel)
- return false;
- if (!event.touchesLength)
- return true;
- for (size_t i = 0; i < event.touchesLength; ++i) {
- if (event.touches[i].state != blink::WebTouchPoint::StateReleased &&
- event.touches[i].state != blink::WebTouchPoint::StateCancelled)
- return false;
- }
- return true;
-}
-
-void WebTouchEventTraits::ResetType(WebInputEvent::Type type,
- double timestamp_sec,
- WebTouchEvent* event) {
- DCHECK(WebInputEvent::isTouchEventType(type));
- event->type = type;
- event->cancelable = (type != WebInputEvent::TouchCancel);
- event->timeStampSeconds = timestamp_sec;
-}
-
-void WebTouchEventTraits::ResetTypeAndTouchStates(WebInputEvent::Type type,
- double timestamp_sec,
- WebTouchEvent* event) {
- ResetType(type, timestamp_sec, event);
-
- WebTouchPoint::State newState = WebTouchPoint::StateUndefined;
- switch (event->type) {
- case WebInputEvent::TouchStart:
- newState = WebTouchPoint::StatePressed;
- break;
- case WebInputEvent::TouchMove:
- newState = WebTouchPoint::StateMoved;
- break;
- case WebInputEvent::TouchEnd:
- newState = WebTouchPoint::StateReleased;
- break;
- case WebInputEvent::TouchCancel:
- newState = WebTouchPoint::StateCancelled;
- break;
- default:
- NOTREACHED();
- break;
- }
- for (size_t i = 0; i < event->touchesLength; ++i)
- event->touches[i].state = newState;
-}
-
-} // namespace content
« no previous file with comments | « content/common/input/web_touch_event_traits.h ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698