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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h

Issue 1601303003: Fix smooth scroll overshooting when mouse held down in scrollbar track. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
Index: third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h b/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h
index 3b4dd4888df96a43277fb32dc6c3de140db46b65..87a528eb32d5ef5d993ffe34cd0910b23778429b 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h
+++ b/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h
@@ -30,6 +30,7 @@
#include "platform/geometry/IntRect.h"
#include "platform/graphics/paint/DisplayItem.h"
#include "platform/scroll/ScrollTypes.h"
+#include "platform/scroll/ScrollbarThemeClient.h"
#include "public/platform/WebScrollbarButtonsPlacement.h"
namespace blink {
@@ -37,7 +38,6 @@ namespace blink {
class CullRect;
class GraphicsContext;
class PlatformMouseEvent;
-class ScrollbarThemeClient;
class ScrollbarThemePaintParams;
class PLATFORM_EXPORT ScrollbarTheme {
@@ -85,7 +85,9 @@ public:
virtual bool shouldDragDocumentInsteadOfThumb(const ScrollbarThemeClient&, const PlatformMouseEvent&) { return false; }
// The position of the thumb relative to the track.
- virtual int thumbPosition(const ScrollbarThemeClient&);
+ int thumbPosition(const ScrollbarThemeClient& scrollbar) { return thumbPosition(scrollbar, scrollbar.currentPos()); }
+ // The position the thumb would have, relative to the track, at the specified scroll position.
+ virtual int thumbPosition(const ScrollbarThemeClient&, float scrollPosition);
// The length of the thumb along the axis of the scrollbar.
virtual int thumbLength(const ScrollbarThemeClient&);
// The position of the track relative to the scrollbar.

Powered by Google App Engine
This is Rietveld 408576698