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

Unified Diff: ui/events/devices/device_data_manager.cc

Issue 1182303005: Fixed the Touchscreen.TouchEventsEnabled histogram to record the correct values on X11 and Ozone ba… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated comment in ChromeBrowserMainExtraPartsMetrics::PostBrowserStart(). Created 5 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 side-by-side diff with in-line comments
Download patch
Index: ui/events/devices/device_data_manager.cc
diff --git a/ui/events/devices/device_data_manager.cc b/ui/events/devices/device_data_manager.cc
index 97c746188dfdaaf1c181019b01626d7cc4cff6c5..7aea4e1004ca03a67ccafe64c2b37ba6523e959f 100644
--- a/ui/events/devices/device_data_manager.cc
+++ b/ui/events/devices/device_data_manager.cc
@@ -132,9 +132,7 @@ void DeviceDataManager::OnTouchscreenDevicesUpdated(
return;
}
touchscreen_devices_ = devices;
- FOR_EACH_OBSERVER(InputDeviceEventObserver,
- observers_,
- OnTouchscreenDeviceConfigurationChanged());
+ NotifyObserversTouchscreenDeviceConfigurationChanged();
}
void DeviceDataManager::OnKeyboardDevicesUpdated(
@@ -147,9 +145,7 @@ void DeviceDataManager::OnKeyboardDevicesUpdated(
return;
}
keyboard_devices_ = devices;
- FOR_EACH_OBSERVER(InputDeviceEventObserver,
- observers_,
- OnKeyboardDeviceConfigurationChanged());
+ NotifyObserversKeyboardDeviceConfigurationChanged();
}
void DeviceDataManager::OnMouseDevicesUpdated(
@@ -162,9 +158,7 @@ void DeviceDataManager::OnMouseDevicesUpdated(
return;
}
mouse_devices_ = devices;
- FOR_EACH_OBSERVER(InputDeviceEventObserver,
- observers_,
- OnMouseDeviceConfigurationChanged());
+ NotifyObserversMouseDeviceConfigurationChanged();
}
void DeviceDataManager::OnTouchpadDevicesUpdated(
@@ -177,17 +171,39 @@ void DeviceDataManager::OnTouchpadDevicesUpdated(
return;
}
touchpad_devices_ = devices;
- FOR_EACH_OBSERVER(InputDeviceEventObserver,
- observers_,
- OnTouchpadDeviceConfigurationChanged());
+ NotifyObserversTouchpadDeviceConfigurationChanged();
}
void DeviceDataManager::OnDeviceListsComplete() {
if (!device_lists_complete_) {
device_lists_complete_ = true;
+ NotifyObserversDeviceListsComplete();
+ }
+}
+
+void DeviceDataManager::NotifyObserversTouchscreenDeviceConfigurationChanged() {
+ FOR_EACH_OBSERVER(InputDeviceEventObserver, observers_,
+ OnTouchscreenDeviceConfigurationChanged());
+}
+
+void DeviceDataManager::NotifyObserversKeyboardDeviceConfigurationChanged() {
+ FOR_EACH_OBSERVER(InputDeviceEventObserver, observers_,
+ OnKeyboardDeviceConfigurationChanged());
+}
+
+void DeviceDataManager::NotifyObserversMouseDeviceConfigurationChanged() {
+ FOR_EACH_OBSERVER(InputDeviceEventObserver, observers_,
+ OnMouseDeviceConfigurationChanged());
+}
+
+void DeviceDataManager::NotifyObserversTouchpadDeviceConfigurationChanged() {
+ FOR_EACH_OBSERVER(InputDeviceEventObserver, observers_,
+ OnTouchpadDeviceConfigurationChanged());
+}
+
+void DeviceDataManager::NotifyObserversDeviceListsComplete() {
FOR_EACH_OBSERVER(InputDeviceEventObserver, observers_,
OnDeviceListsComplete());
- }
}
void DeviceDataManager::AddObserver(InputDeviceEventObserver* observer) {

Powered by Google App Engine
This is Rietveld 408576698