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

Unified Diff: ui/events/devices/x11/device_data_manager_x11.cc

Issue 2077163003: Reduced number of UpdateDeviceList calls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed ALL_DEVICES to kAllDevices Created 4 years, 5 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
« no previous file with comments | « ui/events/devices/x11/device_data_manager_x11.h ('k') | ui/events/platform/x11/x11_event_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/devices/x11/device_data_manager_x11.cc
diff --git a/ui/events/devices/x11/device_data_manager_x11.cc b/ui/events/devices/x11/device_data_manager_x11.cc
index 51927e4327be15081838d9b071b033260d4c7260..0fd13e33b112d03feb7310e68c38e6fc5ab291e7 100644
--- a/ui/events/devices/x11/device_data_manager_x11.cc
+++ b/ui/events/devices/x11/device_data_manager_x11.cc
@@ -560,10 +560,16 @@ void DeviceDataManagerX11::GetScrollClassOffsets(const XEvent& xev,
}
}
-void DeviceDataManagerX11::InvalidateScrollClasses() {
- for (int i = 0; i < kMaxDeviceNum; i++) {
- scroll_data_[i].horizontal.seen = false;
- scroll_data_[i].vertical.seen = false;
+void DeviceDataManagerX11::InvalidateScrollClasses(int device_id) {
+ if (device_id == kAllDevices) {
+ for (int i = 0; i < kMaxDeviceNum; i++) {
+ scroll_data_[i].horizontal.seen = false;
+ scroll_data_[i].vertical.seen = false;
+ }
+ } else {
+ CHECK(device_id >= 0 && device_id < kMaxDeviceNum);
+ scroll_data_[device_id].horizontal.seen = false;
+ scroll_data_[device_id].vertical.seen = false;
}
}
« no previous file with comments | « ui/events/devices/x11/device_data_manager_x11.h ('k') | ui/events/platform/x11/x11_event_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698