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

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

Issue 946173002: Make PointerDeviceObserver use ui::InputDeviceEventObserver on X11 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
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 #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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
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( 152 void DeviceDataManager::OnMouseDevicesUpdated(
153 const std::vector<InputDevice>& devices) { 153 const std::vector<InputDevice>& devices) {
154 if (devices.size() == mouse_devices_.size() &&
155 std::equal(devices.begin(),
156 devices.end(),
157 mouse_devices_.begin(),
158 InputDeviceEquals)) {
159 return;
160 }
161 mouse_devices_ = devices;
154 FOR_EACH_OBSERVER(InputDeviceEventObserver, 162 FOR_EACH_OBSERVER(InputDeviceEventObserver,
155 observers_, 163 observers_,
156 OnMouseDeviceConfigurationChanged()); 164 OnMouseDeviceConfigurationChanged());
157 } 165 }
158 166
159 void DeviceDataManager::OnTouchpadDevicesUpdated( 167 void DeviceDataManager::OnTouchpadDevicesUpdated(
160 const std::vector<InputDevice>& devices) { 168 const std::vector<InputDevice>& devices) {
169 if (devices.size() == touchpad_devices_.size() &&
170 std::equal(devices.begin(),
171 devices.end(),
172 touchpad_devices_.begin(),
173 InputDeviceEquals)) {
174 return;
175 }
176 touchpad_devices_ = devices;
161 FOR_EACH_OBSERVER(InputDeviceEventObserver, 177 FOR_EACH_OBSERVER(InputDeviceEventObserver,
162 observers_, 178 observers_,
163 OnTouchpadDeviceConfigurationChanged()); 179 OnTouchpadDeviceConfigurationChanged());
164 } 180 }
165 181
166 void DeviceDataManager::AddObserver(InputDeviceEventObserver* observer) { 182 void DeviceDataManager::AddObserver(InputDeviceEventObserver* observer) {
167 observers_.AddObserver(observer); 183 observers_.AddObserver(observer);
168 } 184 }
169 185
170 void DeviceDataManager::RemoveObserver(InputDeviceEventObserver* observer) { 186 void DeviceDataManager::RemoveObserver(InputDeviceEventObserver* observer) {
171 observers_.RemoveObserver(observer); 187 observers_.RemoveObserver(observer);
172 } 188 }
173 189
174 } // namespace ui 190 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698