| 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 #ifndef UI_EVENTS_DEVICE_DATA_MANAGER_H_ | 5 #ifndef UI_EVENTS_DEVICE_DATA_MANAGER_H_ |
| 6 #define UI_EVENTS_DEVICE_DATA_MANAGER_H_ | 6 #define UI_EVENTS_DEVICE_DATA_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 void RemoveObserver(InputDeviceEventObserver* observer); | 54 void RemoveObserver(InputDeviceEventObserver* observer); |
| 55 | 55 |
| 56 protected: | 56 protected: |
| 57 DeviceDataManager(); | 57 DeviceDataManager(); |
| 58 | 58 |
| 59 static DeviceDataManager* instance(); | 59 static DeviceDataManager* instance(); |
| 60 | 60 |
| 61 // DeviceHotplugEventObserver: | 61 // DeviceHotplugEventObserver: |
| 62 void OnTouchscreenDevicesUpdated( | 62 void OnTouchscreenDevicesUpdated( |
| 63 const std::vector<TouchscreenDevice>& devices) override; | 63 const std::vector<TouchscreenDevice>& devices) override; |
| 64 virtual void OnKeyboardDevicesUpdated( | 64 void OnKeyboardDevicesUpdated( |
| 65 const std::vector<KeyboardDevice>& devices) override; | 65 const std::vector<KeyboardDevice>& devices) override; |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 static DeviceDataManager* instance_; | 68 static DeviceDataManager* instance_; |
| 69 | 69 |
| 70 bool IsTouchDeviceIdValid(unsigned int touch_device_id) const; | 70 bool IsTouchDeviceIdValid(unsigned int touch_device_id) const; |
| 71 | 71 |
| 72 double touch_radius_scale_map_[kMaxDeviceNum]; | 72 double touch_radius_scale_map_[kMaxDeviceNum]; |
| 73 | 73 |
| 74 // Table to keep track of which display id is mapped to which touch device. | 74 // Table to keep track of which display id is mapped to which touch device. |
| 75 int64_t touch_device_to_display_map_[kMaxDeviceNum]; | 75 int64_t touch_device_to_display_map_[kMaxDeviceNum]; |
| 76 // Index table to find the TouchTransformer for a touch device. | 76 // Index table to find the TouchTransformer for a touch device. |
| 77 gfx::Transform touch_device_transformer_map_[kMaxDeviceNum]; | 77 gfx::Transform touch_device_transformer_map_[kMaxDeviceNum]; |
| 78 | 78 |
| 79 std::vector<TouchscreenDevice> touchscreen_devices_; | 79 std::vector<TouchscreenDevice> touchscreen_devices_; |
| 80 std::vector<KeyboardDevice> keyboard_devices_; | 80 std::vector<KeyboardDevice> keyboard_devices_; |
| 81 | 81 |
| 82 ObserverList<InputDeviceEventObserver> observers_; | 82 ObserverList<InputDeviceEventObserver> observers_; |
| 83 | 83 |
| 84 DISALLOW_COPY_AND_ASSIGN(DeviceDataManager); | 84 DISALLOW_COPY_AND_ASSIGN(DeviceDataManager); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 } // namespace ui | 87 } // namespace ui |
| 88 | 88 |
| 89 #endif // UI_EVENTS_DEVICE_DATA_MANAGER_H_ | 89 #endif // UI_EVENTS_DEVICE_DATA_MANAGER_H_ |
| OLD | NEW |