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

Side by Side Diff: ui/events/gesture_detection/touch_disposition_gesture_filter.cc

Issue 828633002: replace COMPILE_ASSERT with static_assert in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix for rebase Created 5 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 unified diff | Download patch
« no previous file with comments | « ui/base/x/selection_requestor.cc ('k') | ui/events/gesture_detection/velocity_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/base/x/selection_requestor.cc ('k') | ui/events/gesture_detection/velocity_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698