OLD | NEW |
(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 bool WebTouchEventTraits::IsTouchSequenceStart(const WebTouchEvent& event) { |
| 15 if (event.type != WebInputEvent::TouchStart) |
| 16 return false; |
| 17 DCHECK(event.touchesLength); |
| 18 if (!event.touchesLength) |
| 19 return false; |
| 20 for (size_t i = 0; i < event.touchesLength; i++) { |
| 21 if (event.touches[i].state != blink::WebTouchPoint::StatePressed) |
| 22 return false; |
| 23 } |
| 24 return true; |
| 25 } |
| 26 |
| 27 } // namespace content |
OLD | NEW |