OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "ui/events/gesture_detection/touch_disposition_gesture_filter.h" | 5 #include "ui/events/gesture_detection/touch_disposition_gesture_filter.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "ui/events/gesture_event_details.h" | 9 #include "ui/events/gesture_event_details.h" |
10 | 10 |
11 namespace ui { | 11 namespace ui { |
12 namespace { | 12 namespace { |
13 | 13 |
14 // A BitSet32 is used for tracking dropped gesture types. | 14 // A BitSet32 is used for tracking dropped gesture types. |
15 COMPILE_ASSERT(ET_GESTURE_TYPE_END - ET_GESTURE_TYPE_START < 32, | 15 static_assert(ET_GESTURE_TYPE_END - ET_GESTURE_TYPE_START < 32, |
16 gesture_type_count_too_large); | 16 "gesture type count too large"); |
17 | 17 |
18 GestureEventData CreateGesture(EventType type, | 18 GestureEventData CreateGesture(EventType type, |
19 int motion_event_id, | 19 int motion_event_id, |
20 MotionEvent::ToolType primary_tool_type, | 20 MotionEvent::ToolType primary_tool_type, |
21 const GestureEventDataPacket& packet) { | 21 const GestureEventDataPacket& packet) { |
22 // As the event is purely synthetic, we needn't be strict with event flags. | 22 // As the event is purely synthetic, we needn't be strict with event flags. |
23 int flags = EF_NONE; | 23 int flags = EF_NONE; |
24 return GestureEventData(GestureEventDetails(type), | 24 return GestureEventData(GestureEventDetails(type), |
25 motion_event_id, | 25 motion_event_id, |
26 primary_tool_type, | 26 primary_tool_type, |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 return false; | 461 return false; |
462 } | 462 } |
463 | 463 |
464 bool TouchDispositionGestureFilter::GestureHandlingState:: | 464 bool TouchDispositionGestureFilter::GestureHandlingState:: |
465 HasFilteredGestureType(EventType gesture_type) const { | 465 HasFilteredGestureType(EventType gesture_type) const { |
466 return any_gesture_of_type_dropped_.has_bit( | 466 return any_gesture_of_type_dropped_.has_bit( |
467 GetGestureTypeIndex(gesture_type)); | 467 GetGestureTypeIndex(gesture_type)); |
468 } | 468 } |
469 | 469 |
470 } // namespace content | 470 } // namespace content |
OLD | NEW |