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

Side by Side Diff: ui/events/devices/device_data_manager.h

Issue 2019413002: Remove KeyboardDevice class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes for comments. 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
« no previous file with comments | « ui/events/devices/BUILD.gn ('k') | ui/events/devices/device_data_manager.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 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 #ifndef UI_EVENTS_DEVICES_DEVICE_DATA_MANAGER_H_ 5 #ifndef UI_EVENTS_DEVICES_DEVICE_DATA_MANAGER_H_
6 #define UI_EVENTS_DEVICES_DEVICE_DATA_MANAGER_H_ 6 #define UI_EVENTS_DEVICES_DEVICE_DATA_MANAGER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <array> 10 #include <array>
11 #include <memory> 11 #include <memory>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "ui/events/devices/device_hotplug_event_observer.h" 16 #include "ui/events/devices/device_hotplug_event_observer.h"
17 #include "ui/events/devices/events_devices_export.h" 17 #include "ui/events/devices/events_devices_export.h"
18 #include "ui/events/devices/keyboard_device.h"
19 #include "ui/events/devices/touchscreen_device.h" 18 #include "ui/events/devices/touchscreen_device.h"
20 #include "ui/gfx/transform.h" 19 #include "ui/gfx/transform.h"
21 20
22 namespace ui { 21 namespace ui {
23 22
24 namespace test { 23 namespace test {
25 class DeviceDataManagerTestAPI; 24 class DeviceDataManagerTestAPI;
26 } // namespace test 25 } // namespace test
27 26
28 class InputDeviceEventObserver; 27 class InputDeviceEventObserver;
(...skipping 19 matching lines...) Expand all
48 // Gets the display that touches from |touch_device_id| should be sent to. 47 // Gets the display that touches from |touch_device_id| should be sent to.
49 int64_t GetTargetDisplayForTouchDevice(int touch_device_id) const; 48 int64_t GetTargetDisplayForTouchDevice(int touch_device_id) const;
50 49
51 void UpdateTouchRadiusScale(int touch_device_id, double scale); 50 void UpdateTouchRadiusScale(int touch_device_id, double scale);
52 void ApplyTouchRadiusScale(int touch_device_id, double* radius); 51 void ApplyTouchRadiusScale(int touch_device_id, double* radius);
53 52
54 const std::vector<TouchscreenDevice>& touchscreen_devices() const { 53 const std::vector<TouchscreenDevice>& touchscreen_devices() const {
55 return touchscreen_devices_; 54 return touchscreen_devices_;
56 } 55 }
57 56
58 const std::vector<KeyboardDevice>& keyboard_devices() const { 57 const std::vector<InputDevice>& keyboard_devices() const {
59 return keyboard_devices_; 58 return keyboard_devices_;
60 } 59 }
61 60
62 const std::vector<InputDevice>& mouse_devices() const { 61 const std::vector<InputDevice>& mouse_devices() const {
63 return mouse_devices_; 62 return mouse_devices_;
64 } 63 }
65 64
66 const std::vector<InputDevice>& touchpad_devices() const { 65 const std::vector<InputDevice>& touchpad_devices() const {
67 return touchpad_devices_; 66 return touchpad_devices_;
68 } 67 }
(...skipping 10 matching lines...) Expand all
79 DeviceDataManager(); 78 DeviceDataManager();
80 79
81 static DeviceDataManager* instance(); 80 static DeviceDataManager* instance();
82 81
83 static void set_instance(DeviceDataManager* instance); 82 static void set_instance(DeviceDataManager* instance);
84 83
85 // DeviceHotplugEventObserver: 84 // DeviceHotplugEventObserver:
86 void OnTouchscreenDevicesUpdated( 85 void OnTouchscreenDevicesUpdated(
87 const std::vector<TouchscreenDevice>& devices) override; 86 const std::vector<TouchscreenDevice>& devices) override;
88 void OnKeyboardDevicesUpdated( 87 void OnKeyboardDevicesUpdated(
89 const std::vector<KeyboardDevice>& devices) override; 88 const std::vector<InputDevice>& devices) override;
90 void OnMouseDevicesUpdated( 89 void OnMouseDevicesUpdated(
91 const std::vector<InputDevice>& devices) override; 90 const std::vector<InputDevice>& devices) override;
92 void OnTouchpadDevicesUpdated( 91 void OnTouchpadDevicesUpdated(
93 const std::vector<InputDevice>& devices) override; 92 const std::vector<InputDevice>& devices) override;
94 void OnDeviceListsComplete() override; 93 void OnDeviceListsComplete() override;
95 94
96 private: 95 private:
97 // Information related to a touchscreen device. 96 // Information related to a touchscreen device.
98 struct TouchscreenInfo { 97 struct TouchscreenInfo {
99 TouchscreenInfo(); 98 TouchscreenInfo();
(...skipping 10 matching lines...) Expand all
110 109
111 bool IsTouchDeviceIdValid(int touch_device_id) const; 110 bool IsTouchDeviceIdValid(int touch_device_id) const;
112 111
113 void NotifyObserversTouchscreenDeviceConfigurationChanged(); 112 void NotifyObserversTouchscreenDeviceConfigurationChanged();
114 void NotifyObserversKeyboardDeviceConfigurationChanged(); 113 void NotifyObserversKeyboardDeviceConfigurationChanged();
115 void NotifyObserversMouseDeviceConfigurationChanged(); 114 void NotifyObserversMouseDeviceConfigurationChanged();
116 void NotifyObserversTouchpadDeviceConfigurationChanged(); 115 void NotifyObserversTouchpadDeviceConfigurationChanged();
117 void NotifyObserversDeviceListsComplete(); 116 void NotifyObserversDeviceListsComplete();
118 117
119 std::vector<TouchscreenDevice> touchscreen_devices_; 118 std::vector<TouchscreenDevice> touchscreen_devices_;
120 std::vector<KeyboardDevice> keyboard_devices_; 119 std::vector<InputDevice> keyboard_devices_;
121 std::vector<InputDevice> mouse_devices_; 120 std::vector<InputDevice> mouse_devices_;
122 std::vector<InputDevice> touchpad_devices_; 121 std::vector<InputDevice> touchpad_devices_;
123 bool device_lists_complete_ = false; 122 bool device_lists_complete_ = false;
124 123
125 base::ObserverList<InputDeviceEventObserver> observers_; 124 base::ObserverList<InputDeviceEventObserver> observers_;
126 125
127 bool touch_screens_enabled_ = true; 126 bool touch_screens_enabled_ = true;
128 127
129 // Contains touchscreen device info for each device mapped by device ID. Will 128 // Contains touchscreen device info for each device mapped by device ID. Will
130 // have default values if the device with corresponding ID isn't a touchscreen 129 // have default values if the device with corresponding ID isn't a touchscreen
131 // or doesn't exist. 130 // or doesn't exist.
132 std::array<TouchscreenInfo, kMaxDeviceNum> touch_map_; 131 std::array<TouchscreenInfo, kMaxDeviceNum> touch_map_;
133 132
134 DISALLOW_COPY_AND_ASSIGN(DeviceDataManager); 133 DISALLOW_COPY_AND_ASSIGN(DeviceDataManager);
135 }; 134 };
136 135
137 } // namespace ui 136 } // namespace ui
138 137
139 #endif // UI_EVENTS_DEVICES_DEVICE_DATA_MANAGER_H_ 138 #endif // UI_EVENTS_DEVICES_DEVICE_DATA_MANAGER_H_
OLDNEW
« no previous file with comments | « ui/events/devices/BUILD.gn ('k') | ui/events/devices/device_data_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698