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

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

Issue 2230183002: ui: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 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/events/ozone/evdev/input_device_factory_evdev.cc ('k') | ui/gl/gl_gl_api_implementation.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 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 #include "ui/events/ozone/evdev/touch_noise/touch_noise_finder.h" 5 #include "ui/events/ozone/evdev/touch_noise/touch_noise_finder.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "ui/events/event_utils.h" 9 #include "ui/events/event_utils.h"
10 #include "ui/events/ozone/evdev/touch_noise/far_apart_taps_touch_noise_filter.h" 10 #include "ui/events/ozone/evdev/touch_noise/far_apart_taps_touch_noise_filter.h"
11 #include "ui/events/ozone/evdev/touch_noise/horizontally_aligned_touch_noise_fil ter.h" 11 #include "ui/events/ozone/evdev/touch_noise/horizontally_aligned_touch_noise_fil ter.h"
12 #include "ui/events/ozone/evdev/touch_noise/single_position_touch_noise_filter.h " 12 #include "ui/events/ozone/evdev/touch_noise/single_position_touch_noise_filter.h "
13 #include "ui/events/ozone/evdev/touch_noise/touch_noise_filter.h" 13 #include "ui/events/ozone/evdev/touch_noise/touch_noise_filter.h"
14 14
15 namespace ui { 15 namespace ui {
16 16
17 TouchNoiseFinder::TouchNoiseFinder() : last_noise_time_(ui::EventTimeForNow()) { 17 TouchNoiseFinder::TouchNoiseFinder() : last_noise_time_(ui::EventTimeForNow()) {
18 filters_.push_back(new FarApartTapsTouchNoiseFilter); 18 filters_.push_back(new FarApartTapsTouchNoiseFilter);
19 filters_.push_back(new HorizontallyAlignedTouchNoiseFilter); 19 filters_.push_back(new HorizontallyAlignedTouchNoiseFilter);
20 filters_.push_back(new SinglePositionTouchNoiseFilter); 20 filters_.push_back(new SinglePositionTouchNoiseFilter);
21 } 21 }
22 22
23 TouchNoiseFinder::~TouchNoiseFinder() { 23 TouchNoiseFinder::~TouchNoiseFinder() {
24 STLDeleteElements(&filters_); 24 base::STLDeleteElements(&filters_);
25 } 25 }
26 26
27 void TouchNoiseFinder::HandleTouches( 27 void TouchNoiseFinder::HandleTouches(
28 const std::vector<InProgressTouchEvdev>& touches, 28 const std::vector<InProgressTouchEvdev>& touches,
29 base::TimeTicks time) { 29 base::TimeTicks time) {
30 for (const InProgressTouchEvdev& touch : touches) { 30 for (const InProgressTouchEvdev& touch : touches) {
31 if (!touch.was_touching) 31 if (!touch.was_touching)
32 slots_with_noise_.set(touch.slot, false); 32 slots_with_noise_.set(touch.slot, false);
33 } 33 }
34 34
(...skipping 15 matching lines...) Expand all
50 UMA_HISTOGRAM_LONG_TIMES( 50 UMA_HISTOGRAM_LONG_TIMES(
51 "Ozone.TouchNoiseFilter.TimeSinceLastNoiseOccurrence", 51 "Ozone.TouchNoiseFilter.TimeSinceLastNoiseOccurrence",
52 time - last_noise_time_); 52 time - last_noise_time_);
53 } 53 }
54 54
55 last_noise_time_ = time; 55 last_noise_time_ = time;
56 } 56 }
57 } 57 }
58 58
59 } // namespace ui 59 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/input_device_factory_evdev.cc ('k') | ui/gl/gl_gl_api_implementation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698