Index: content/renderer/webscrollbarbehavior_impl_gtkoraura.cc |
diff --git a/content/renderer/webscrollbarbehavior_impl_gtkoraura.cc b/content/renderer/webscrollbarbehavior_impl_gtkoraura.cc |
index b866e29138fc2cc096147b072b3ea896516d19f3..8dfa99846be2ea1e889e5d1201a1395bea0ef2c3 100644 |
--- a/content/renderer/webscrollbarbehavior_impl_gtkoraura.cc |
+++ b/content/renderer/webscrollbarbehavior_impl_gtkoraura.cc |
@@ -31,11 +31,17 @@ bool WebScrollbarBehaviorImpl::shouldSnapBackToDragOrigin( |
// guessing/extrapolation. |
static const int kOffEndMultiplier = 3; |
static const int kOffSideMultiplier = 8; |
+ static const int kDefaultWinScrollbarThickness = 17; |
// Find the rect within which we shouldn't snap, by expanding the track rect |
// in both dimensions. |
gfx::Rect noSnapRect(scrollbarRect); |
- const int thickness = isHorizontal ? noSnapRect.height() : noSnapRect.width(); |
+ int thickness = isHorizontal ? noSnapRect.height() : noSnapRect.width(); |
+ // Even if the platform's scrollbar is narrower than the default Windows one, |
+ // we still want to provide at least as much slop area, since a slightly |
+ // narrower scrollbar doesn't necessarily imply that users will drag |
+ // straighter. |
+ thickness = std::max(thickness, kDefaultWinScrollbarThickness); |
noSnapRect.Inset( |
(isHorizontal ? kOffEndMultiplier : kOffSideMultiplier) * -thickness, |
(isHorizontal ? kOffSideMultiplier : kOffEndMultiplier) * -thickness); |