OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/common/input/web_input_event_traits.h" | 5 #include "content/common/input/web_input_event_traits.h" |
6 | 6 |
7 #include <bitset> | 7 #include <bitset> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 | 10 |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 case WebInputEvent::MouseEnter: | 332 case WebInputEvent::MouseEnter: |
333 case WebInputEvent::MouseLeave: | 333 case WebInputEvent::MouseLeave: |
334 case WebInputEvent::ContextMenu: | 334 case WebInputEvent::ContextMenu: |
335 return true; | 335 return true; |
336 default: | 336 default: |
337 break; | 337 break; |
338 } | 338 } |
339 return false; | 339 return false; |
340 } | 340 } |
341 | 341 |
| 342 bool WebInputEventTraits::IsNewTouchSequence(const WebTouchEvent& event) { |
| 343 if (event.type != WebInputEvent::TouchStart) |
| 344 return false; |
| 345 DCHECK(event.touchesLength); |
| 346 if (!event.touchesLength) |
| 347 return false; |
| 348 for (size_t i = 0; i < event.touchesLength; i++) { |
| 349 if (event.touches[i].state != blink::WebTouchPoint::StatePressed) |
| 350 return false; |
| 351 } |
| 352 return true; |
| 353 } |
| 354 |
342 } // namespace content | 355 } // namespace content |
OLD | NEW |