Chromium Code Reviews| Index: content/renderer/webscrollbarbehavior_impl_aura.cc |
| diff --git a/content/renderer/webscrollbarbehavior_impl_gtkoraura.cc b/content/renderer/webscrollbarbehavior_impl_aura.cc |
| similarity index 82% |
| rename from content/renderer/webscrollbarbehavior_impl_gtkoraura.cc |
| rename to content/renderer/webscrollbarbehavior_impl_aura.cc |
| index a07e1d47fd727d6ee9492fde8e625acd39fc1154..489684ec7e52d3b55ebb963097d915823b8bb9fe 100644 |
| --- a/content/renderer/webscrollbarbehavior_impl_gtkoraura.cc |
| +++ b/content/renderer/webscrollbarbehavior_impl_aura.cc |
| @@ -2,7 +2,7 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "content/renderer/webscrollbarbehavior_impl_gtkoraura.h" |
| +#include "content/renderer/webscrollbarbehavior_impl_aura.h" |
| #include "build/build_config.h" |
| #include "third_party/WebKit/public/platform/WebPoint.h" |
| @@ -26,6 +26,11 @@ bool WebScrollbarBehaviorImpl::shouldSnapBackToDragOrigin( |
| const blink::WebPoint& eventPoint, |
| const blink::WebRect& scrollbarRect, |
| bool isHorizontal) { |
| +// Disable snapback on desktop Linux. See crbug.com/567968 for context. |
|
Peter Kasting
2016/11/08 02:59:13
FWIW, I'd omit the bug link and simply summarize h
Tom (Use chromium acct)
2016/11/08 03:07:45
Done.
|
| +#if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) |
| + return false; |
| +#endif |
| + |
| // Constants used to figure the drag rect outside which we should snap the |
| // scrollbar thumb back to its origin. These calculations are based on |
| // observing the behavior of the MSVC8 main window scrollbar + some |
| @@ -47,16 +52,7 @@ bool WebScrollbarBehaviorImpl::shouldSnapBackToDragOrigin( |
| (isHorizontal ? kOffEndMultiplier : kOffSideMultiplier) * -thickness, |
| (isHorizontal ? kOffSideMultiplier : kOffEndMultiplier) * -thickness); |
| - // On most platforms, we should snap iff the event is outside our calculated |
| - // rect. On Linux, however, we should not snap for events off the ends, but |
| - // not the sides, of the rect. |
| -#if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) |
| - return isHorizontal ? |
| - (eventPoint.y < noSnapRect.y() || eventPoint.y >= noSnapRect.bottom()) : |
| - (eventPoint.x < noSnapRect.x() || eventPoint.x >= noSnapRect.right()); |
| -#else |
| return !noSnapRect.Contains(eventPoint); |
| -#endif |
| } |
| } // namespace content |