Scroll by 3 pixels if sent from touchpad

BUG=106481
TEST=Manual

Review URL: http://codereview.chromium.org/8801033

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113067 0039d316-1c4b-4281-b951-d872f2087c98
parent 2b304724
...@@ -24,6 +24,10 @@ static const int kWheelScrollAmount = 53; ...@@ -24,6 +24,10 @@ static const int kWheelScrollAmount = 53;
static const int kMinWheelButton = 4; static const int kMinWheelButton = 4;
#if defined(OS_CHROMEOS) #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. // Chrome OS also uses buttons 8 and 9 for scrolling.
static const int kMaxWheelButton = 9; static const int kMaxWheelButton = 9;
#else #else
...@@ -312,12 +316,14 @@ int GetMouseWheelOffset(const base::NativeEvent& native_event) { ...@@ -312,12 +316,14 @@ int GetMouseWheelOffset(const base::NativeEvent& native_event) {
switch (button) { switch (button) {
case 4: case 4:
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
return kTouchpadScrollAmount;
case 8: case 8:
#endif #endif
return kWheelScrollAmount; return kWheelScrollAmount;
case 5: case 5:
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
return -kTouchpadScrollAmount;
case 9: case 9:
#endif #endif
return -kWheelScrollAmount; return -kWheelScrollAmount;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment