| 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/ozone/evdev/touch_event_converter_evdev.h" | 5 #include "ui/events/ozone/evdev/touch_event_converter_evdev.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <linux/input.h> | 8 #include <linux/input.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <unistd.h> | 10 #include <unistd.h> |
| (...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 : public TouchEventConverterEvdevTest { | 879 : public TouchEventConverterEvdevTest { |
| 880 public: | 880 public: |
| 881 TouchEventConverterEvdevTouchNoiseTest() {} | 881 TouchEventConverterEvdevTouchNoiseTest() {} |
| 882 ~TouchEventConverterEvdevTouchNoiseTest() override {} | 882 ~TouchEventConverterEvdevTouchNoiseTest() override {} |
| 883 | 883 |
| 884 // Makes the TouchNoiseFinder use |filter| and only |filter| to filter out | 884 // Makes the TouchNoiseFinder use |filter| and only |filter| to filter out |
| 885 // touch noise. | 885 // touch noise. |
| 886 void SetTouchNoiseFilter(std::unique_ptr<TouchNoiseFilter> filter) { | 886 void SetTouchNoiseFilter(std::unique_ptr<TouchNoiseFilter> filter) { |
| 887 TouchNoiseFinder* finder = device()->touch_noise_finder(); | 887 TouchNoiseFinder* finder = device()->touch_noise_finder(); |
| 888 finder->filters_.clear(); | 888 finder->filters_.clear(); |
| 889 finder->filters_.push_back(filter.release()); | 889 finder->filters_.push_back(std::move(filter)); |
| 890 } | 890 } |
| 891 | 891 |
| 892 // Returns the first of TouchNoiseFinder's filters. | 892 // Returns the first of TouchNoiseFinder's filters. |
| 893 ui::TouchNoiseFilter* first_filter() { | 893 ui::TouchNoiseFilter* first_filter() { |
| 894 TouchNoiseFinder* finder = device()->touch_noise_finder(); | 894 TouchNoiseFinder* finder = device()->touch_noise_finder(); |
| 895 return finder->filters_.empty() ? nullptr : *finder->filters_.begin(); | 895 return finder->filters_.empty() ? nullptr : finder->filters_.begin()->get(); |
| 896 } | 896 } |
| 897 | 897 |
| 898 // TouchEventConverterEvdevTest: | 898 // TouchEventConverterEvdevTest: |
| 899 void SetUp() override { | 899 void SetUp() override { |
| 900 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 900 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 901 switches::kExtraTouchNoiseFiltering); | 901 switches::kExtraTouchNoiseFiltering); |
| 902 TouchEventConverterEvdevTest::SetUp(); | 902 TouchEventConverterEvdevTest::SetUp(); |
| 903 } | 903 } |
| 904 | 904 |
| 905 private: | 905 private: |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 | 1140 |
| 1141 event = dispatched_mouse_move_event(6); | 1141 event = dispatched_mouse_move_event(6); |
| 1142 EXPECT_EQ(8930, event.location.x()); | 1142 EXPECT_EQ(8930, event.location.x()); |
| 1143 EXPECT_EQ(980, event.location.y()); | 1143 EXPECT_EQ(980, event.location.y()); |
| 1144 EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN, | 1144 EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN, |
| 1145 event.pointer_details.pointer_type); | 1145 event.pointer_details.pointer_type); |
| 1146 EXPECT_EQ(0.f / 1024, event.pointer_details.force); | 1146 EXPECT_EQ(0.f / 1024, event.pointer_details.force); |
| 1147 } | 1147 } |
| 1148 | 1148 |
| 1149 } // namespace ui | 1149 } // namespace ui |
| OLD | NEW |