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

Side by Side Diff: content/browser/renderer_host/input/web_touch_event_traits.cc

Issue 247433003: Mark touchcancel events as uncancelable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: avi CR feedback Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 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 "content/browser/renderer_host/input/web_touch_event_traits.h"
6
7 #include "base/logging.h"
8
9 using blink::WebInputEvent;
10 using blink::WebTouchEvent;
11
12 namespace content {
13
14 namespace {
15
16 bool AllTouchPointsHaveState(const WebTouchEvent& event,
17 blink::WebTouchPoint::State state) {
18 if(!event.touchesLength)
19 return false;
20 for (size_t i = 0; i < event.touchesLength; ++i) {
21 if (event.touches[i].state != state)
22 return false;
23 }
24 return true;
25 }
26
27 } // namespace
28
29 bool WebTouchEventTraits::IsTouchSequenceStart(const WebTouchEvent& event) {
30 DCHECK(event.touchesLength);
31 if (event.type != WebInputEvent::TouchStart)
32 return false;
33 return AllTouchPointsHaveState(event, blink::WebTouchPoint::StatePressed);
34 }
35
36 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698