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/devices/device_data_manager.h" | 5 #include "ui/events/devices/device_data_manager.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "ui/display/types/display_constants.h" | 10 #include "ui/display/types/display_constants.h" |
11 #include "ui/events/devices/input_device_event_observer.h" | 11 #include "ui/events/devices/input_device_event_observer.h" |
12 #include "ui/gfx/geometry/point3_f.h" | 12 #include "ui/gfx/geometry/point3_f.h" |
13 | 13 |
14 // This macro provides the implementation for the observer notification methods. | 14 // This macro provides the implementation for the observer notification methods. |
15 #define NOTIFY_OBSERVERS(method_decl, observer_call) \ | 15 #define NOTIFY_OBSERVERS(method_decl, observer_call) \ |
16 void DeviceDataManager::method_decl { \ | 16 void DeviceDataManager::method_decl { \ |
17 for (InputDeviceEventObserver& observer : observers_) \ | 17 for (InputDeviceEventObserver& observer : observers_) \ |
18 observer.observer_call; \ | 18 observer.observer_call; \ |
19 } | 19 } |
20 | 20 |
21 namespace ui { | 21 namespace ui { |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 bool InputDeviceEquals(const ui::InputDevice& a, const ui::InputDevice& b) { | 25 bool InputDeviceEquals(const ui::InputDevice& a, const ui::InputDevice& b) { |
26 return a.id == b.id; | 26 return a.id == b.id && a.enabled == b.enabled; |
27 } | 27 } |
28 | 28 |
29 } // namespace | 29 } // namespace |
30 | 30 |
31 DeviceDataManager::TouchscreenInfo::TouchscreenInfo() { | 31 DeviceDataManager::TouchscreenInfo::TouchscreenInfo() { |
32 Reset(); | 32 Reset(); |
33 } | 33 } |
34 | 34 |
35 void DeviceDataManager::TouchscreenInfo::Reset() { | 35 void DeviceDataManager::TouchscreenInfo::Reset() { |
36 radius_scale = 1.0; | 36 radius_scale = 1.0; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 252 |
253 void DeviceDataManager::SetTouchscreensEnabled(bool enabled) { | 253 void DeviceDataManager::SetTouchscreensEnabled(bool enabled) { |
254 touch_screens_enabled_ = enabled; | 254 touch_screens_enabled_ = enabled; |
255 } | 255 } |
256 | 256 |
257 bool DeviceDataManager::AreTouchscreensEnabled() const { | 257 bool DeviceDataManager::AreTouchscreensEnabled() const { |
258 return touch_screens_enabled_; | 258 return touch_screens_enabled_; |
259 } | 259 } |
260 | 260 |
261 } // namespace ui | 261 } // namespace ui |
OLD | NEW |