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/events/devices/input_device_event_observer.h" | 10 #include "ui/events/devices/input_device_event_observer.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 keyboard_devices_.begin(), | 142 keyboard_devices_.begin(), |
143 InputDeviceEquals)) { | 143 InputDeviceEquals)) { |
144 return; | 144 return; |
145 } | 145 } |
146 keyboard_devices_ = devices; | 146 keyboard_devices_ = devices; |
147 FOR_EACH_OBSERVER(InputDeviceEventObserver, | 147 FOR_EACH_OBSERVER(InputDeviceEventObserver, |
148 observers_, | 148 observers_, |
149 OnKeyboardDeviceConfigurationChanged()); | 149 OnKeyboardDeviceConfigurationChanged()); |
150 } | 150 } |
151 | 151 |
| 152 void DeviceDataManager::OnMouseDevicesUpdated( |
| 153 const std::vector<InputDevice>& devices) { |
| 154 FOR_EACH_OBSERVER(InputDeviceEventObserver, |
| 155 observers_, |
| 156 OnMouseDeviceConfigurationChanged()); |
| 157 } |
| 158 |
| 159 void DeviceDataManager::OnTouchpadDevicesUpdated( |
| 160 const std::vector<InputDevice>& devices) { |
| 161 FOR_EACH_OBSERVER(InputDeviceEventObserver, |
| 162 observers_, |
| 163 OnTouchpadDeviceConfigurationChanged()); |
| 164 } |
| 165 |
152 void DeviceDataManager::AddObserver(InputDeviceEventObserver* observer) { | 166 void DeviceDataManager::AddObserver(InputDeviceEventObserver* observer) { |
153 observers_.AddObserver(observer); | 167 observers_.AddObserver(observer); |
154 } | 168 } |
155 | 169 |
156 void DeviceDataManager::RemoveObserver(InputDeviceEventObserver* observer) { | 170 void DeviceDataManager::RemoveObserver(InputDeviceEventObserver* observer) { |
157 observers_.RemoveObserver(observer); | 171 observers_.RemoveObserver(observer); |
158 } | 172 } |
159 | 173 |
160 } // namespace ui | 174 } // namespace ui |
OLD | NEW |