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

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

Issue 8801033: Scroll by 3 pixels if sent from touchpad (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added period Created 9 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/x/events_x.cc
diff --git a/ui/base/x/events_x.cc b/ui/base/x/events_x.cc
index 2c38267b45f9cad0ae87d9d22aa175592e0a898b..3d3b7a65624efa1f29a59441e42b5192e4bd833d 100644
--- a/ui/base/x/events_x.cc
+++ b/ui/base/x/events_x.cc
@@ -24,6 +24,10 @@ static const int kWheelScrollAmount = 53;
static const int kMinWheelButton = 4;
#if defined(OS_CHROMEOS)
+// TODO(davemoore) For now use the button to decide how much to scroll by.
+// When we go to XI2 scroll events this won't be necessary. If this doesn't
+// happen for some reason we can better detect which devices are touchpads.
+static const int kTouchpadScrollAmount = 3;
// Chrome OS also uses buttons 8 and 9 for scrolling.
static const int kMaxWheelButton = 9;
#else
@@ -312,12 +316,14 @@ int GetMouseWheelOffset(const base::NativeEvent& native_event) {
switch (button) {
case 4:
#if defined(OS_CHROMEOS)
+ return kTouchpadScrollAmount;
case 8:
#endif
return kWheelScrollAmount;
case 5:
#if defined(OS_CHROMEOS)
+ return -kTouchpadScrollAmount;
case 9:
#endif
return -kWheelScrollAmount;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698