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

Side by Side Diff: ui/events/ozone/evdev/touch_noise/touch_noise_finder.h

Issue 1975533002: Change ui::Event::time_stamp from TimeDelta to TimeTicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
OLDNEW
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>
(...skipping 10 matching lines...) Expand all
21 // Finds touches which are likely touch noise. 21 // Finds touches which are likely touch noise.
22 class EVENTS_OZONE_EVDEV_EXPORT TouchNoiseFinder { 22 class EVENTS_OZONE_EVDEV_EXPORT TouchNoiseFinder {
23 public: 23 public:
24 TouchNoiseFinder(); 24 TouchNoiseFinder();
25 ~TouchNoiseFinder(); 25 ~TouchNoiseFinder();
26 26
27 // Updates which ABS_MT_SLOTs are noise. |touches| should contain all of the 27 // Updates which ABS_MT_SLOTs are noise. |touches| should contain all of the
28 // in-progress touches at |time| (including noisy touches). 28 // in-progress touches at |time| (including noisy touches).
29 // |touches| should have at most one entry per ABS_MT_SLOT. 29 // |touches| should have at most one entry per ABS_MT_SLOT.
30 void HandleTouches(const std::vector<InProgressTouchEvdev>& touches, 30 void HandleTouches(const std::vector<InProgressTouchEvdev>& touches,
31 base::TimeDelta time); 31 base::TimeTicks time);
32 32
33 // Returns whether the in-progress touch at ABS_MT_SLOT |slot| is noise. 33 // Returns whether the in-progress touch at ABS_MT_SLOT |slot| is noise.
34 bool SlotHasNoise(size_t slot) const; 34 bool SlotHasNoise(size_t slot) const;
35 35
36 private: 36 private:
37 // Records how frequently noisy touches occur to UMA. 37 // Records how frequently noisy touches occur to UMA.
38 void RecordUMA(bool had_noise, base::TimeDelta time); 38 void RecordUMA(bool had_noise, base::TimeTicks time);
39 39
40 friend class TouchEventConverterEvdevTouchNoiseTest; 40 friend class TouchEventConverterEvdevTouchNoiseTest;
41 41
42 // The slots which are noise. 42 // The slots which are noise.
43 std::bitset<kNumTouchEvdevSlots> slots_with_noise_; 43 std::bitset<kNumTouchEvdevSlots> slots_with_noise_;
44 44
45 // The time of the previous noise occurence in any of the slots. 45 // The time of the previous noise occurence in any of the slots.
46 base::TimeDelta last_noise_time_; 46 base::TimeTicks last_noise_time_;
47 47
48 std::vector<TouchNoiseFilter*> filters_; 48 std::vector<TouchNoiseFilter*> filters_;
49 49
50 DISALLOW_COPY_AND_ASSIGN(TouchNoiseFinder); 50 DISALLOW_COPY_AND_ASSIGN(TouchNoiseFinder);
51 }; 51 };
52 52
53 } // namespace ui 53 } // namespace ui
54 54
55 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_NOISE_TOUCH_NOISE_FINDER_H_ 55 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_NOISE_TOUCH_NOISE_FINDER_H_
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/touch_noise/touch_noise_filter.h ('k') | ui/events/ozone/evdev/touch_noise/touch_noise_finder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698