| 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/device_data_manager.h" | 5 #include "ui/events/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/events/input_device_event_observer.h" | 10 #include "ui/events/input_device_event_observer.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 int64_t DeviceDataManager::GetDisplayForTouchDevice(int touch_device_id) const { | 106 int64_t DeviceDataManager::GetDisplayForTouchDevice(int touch_device_id) const { |
| 107 if (IsTouchDeviceIdValid(touch_device_id)) | 107 if (IsTouchDeviceIdValid(touch_device_id)) |
| 108 return touch_device_to_display_map_[touch_device_id]; | 108 return touch_device_to_display_map_[touch_device_id]; |
| 109 return gfx::Display::kInvalidDisplayID; | 109 return gfx::Display::kInvalidDisplayID; |
| 110 } | 110 } |
| 111 | 111 |
| 112 void DeviceDataManager::OnTouchscreenDevicesUpdated( | 112 void DeviceDataManager::OnTouchscreenDevicesUpdated( |
| 113 const std::vector<TouchscreenDevice>& devices) { | 113 const std::vector<TouchscreenDevice>& devices) { |
| 114 touchscreen_devices_ = devices; | 114 touchscreen_devices_ = devices; |
| 115 } |
| 115 | 116 |
| 117 void DeviceDataManager::OnKeyboardDevicesUpdated( |
| 118 const std::vector<KeyboardDevice>& devices) { |
| 119 keyboard_devices_ = devices; |
| 120 } |
| 121 |
| 122 void DeviceDataManager::OnInputDeviceConfigurationChanged() { |
| 116 FOR_EACH_OBSERVER(InputDeviceEventObserver, | 123 FOR_EACH_OBSERVER(InputDeviceEventObserver, |
| 117 observers_, | 124 observers_, |
| 118 OnInputDeviceConfigurationChanged()); | 125 OnInputDeviceConfigurationChanged()); |
| 119 } | 126 } |
| 120 | 127 |
| 121 void DeviceDataManager::AddObserver(InputDeviceEventObserver* observer) { | 128 void DeviceDataManager::AddObserver(InputDeviceEventObserver* observer) { |
| 122 observers_.AddObserver(observer); | 129 observers_.AddObserver(observer); |
| 123 } | 130 } |
| 124 | 131 |
| 125 void DeviceDataManager::RemoveObserver(InputDeviceEventObserver* observer) { | 132 void DeviceDataManager::RemoveObserver(InputDeviceEventObserver* observer) { |
| 126 observers_.RemoveObserver(observer); | 133 observers_.RemoveObserver(observer); |
| 127 } | 134 } |
| 128 | 135 |
| 129 } // namespace ui | 136 } // namespace ui |
| OLD | NEW |