| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef UI_EVENTS_OZONE_EVDEV_TOUCH_NOISE_TOUCH_NOISE_FINDER_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_TOUCH_NOISE_TOUCH_NOISE_FINDER_H_ |
| 6 #define UI_EVENTS_OZONE_EVDEV_TOUCH_NOISE_TOUCH_NOISE_FINDER_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_TOUCH_NOISE_TOUCH_NOISE_FINDER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <bitset> | 10 #include <bitset> |
| 11 #include <memory> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 15 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" | 16 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" |
| 16 #include "ui/events/ozone/evdev/touch_evdev_types.h" | 17 #include "ui/events/ozone/evdev/touch_evdev_types.h" |
| 17 | 18 |
| 18 namespace ui { | 19 namespace ui { |
| 19 class TouchNoiseFilter; | 20 class TouchNoiseFilter; |
| 20 | 21 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 35 | 36 |
| 36 private: | 37 private: |
| 37 // Records how frequently noisy touches occur to UMA. | 38 // Records how frequently noisy touches occur to UMA. |
| 38 void RecordUMA(bool had_noise, base::TimeTicks time); | 39 void RecordUMA(bool had_noise, base::TimeTicks time); |
| 39 | 40 |
| 40 friend class TouchEventConverterEvdevTouchNoiseTest; | 41 friend class TouchEventConverterEvdevTouchNoiseTest; |
| 41 | 42 |
| 42 // The slots which are noise. | 43 // The slots which are noise. |
| 43 std::bitset<kNumTouchEvdevSlots> slots_with_noise_; | 44 std::bitset<kNumTouchEvdevSlots> slots_with_noise_; |
| 44 | 45 |
| 45 // The time of the previous noise occurence in any of the slots. | 46 // The time of the previous noise occurrence in any of the slots. |
| 46 base::TimeTicks last_noise_time_; | 47 base::TimeTicks last_noise_time_; |
| 47 | 48 |
| 48 std::vector<TouchNoiseFilter*> filters_; | 49 std::vector<std::unique_ptr<TouchNoiseFilter>> filters_; |
| 49 | 50 |
| 50 DISALLOW_COPY_AND_ASSIGN(TouchNoiseFinder); | 51 DISALLOW_COPY_AND_ASSIGN(TouchNoiseFinder); |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 } // namespace ui | 54 } // namespace ui |
| 54 | 55 |
| 55 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_NOISE_TOUCH_NOISE_FINDER_H_ | 56 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_NOISE_TOUCH_NOISE_FINDER_H_ |
| OLD | NEW |