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

Unified Diff: ui/events/x/events_x.cc

Issue 405683002: ui: Remove some unnecessary functions from the API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/win/events_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/x/events_x.cc
diff --git a/ui/events/x/events_x.cc b/ui/events/x/events_x.cc
index ae5f2794b253b306f608b796b021ea5a1e38ef7f..c9780ece12c93e45bfd00931e3b3e98d73e1ddc3 100644
--- a/ui/events/x/events_x.cc
+++ b/ui/events/x/events_x.cc
@@ -371,17 +371,17 @@ EventType EventTypeFromNative(const base::NativeEvent& native_event) {
}
case XI_Motion: {
bool is_cancel;
- if (GetFlingData(native_event, NULL, NULL, NULL, NULL, &is_cancel)) {
+ DeviceDataManagerX11* devices = DeviceDataManagerX11::GetInstance();
+ if (GetFlingData(native_event, NULL, NULL, NULL, NULL, &is_cancel))
return is_cancel ? ET_SCROLL_FLING_CANCEL : ET_SCROLL_FLING_START;
- } else if (DeviceDataManagerX11::GetInstance()->IsScrollEvent(
- native_event)) {
- return IsTouchpadEvent(native_event) ? ET_SCROLL : ET_MOUSEWHEEL;
- } else if (DeviceDataManagerX11::GetInstance()->IsCMTMetricsEvent(
- native_event)) {
+ if (devices->IsScrollEvent(native_event)) {
+ return devices->IsTouchpadXInputEvent(native_event) ? ET_SCROLL
+ : ET_MOUSEWHEEL;
+ }
+ if (devices->IsCMTMetricsEvent(native_event))
return ET_UMA_DATA;
- } else if (GetButtonMaskForX2Event(xievent)) {
+ if (GetButtonMaskForX2Event(xievent))
return ET_MOUSE_DRAGGED;
- }
return ET_MOUSE_MOVED;
}
case XI_KeyPress:
@@ -808,8 +808,4 @@ bool GetGestureTimes(const base::NativeEvent& native_event,
return true;
}
-bool IsTouchpadEvent(const base::NativeEvent& event) {
- return DeviceDataManagerX11::GetInstance()->IsTouchpadXInputEvent(event);
-}
-
} // namespace ui
« no previous file with comments | « ui/events/win/events_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698