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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp

Issue 2467693002: Implement overlay scrollbar fade out for non-composited scrollers. (Closed)
Patch Set: sigh....git cl format Created 4 years, 1 month 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/ScrollbarThemeOverlay.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp
index b60cfbcbfbea6ef5c5a60358ba6299897314ea72..9b1fb69267c52a13da0f04d73048b7b99bf13afe 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp
@@ -72,6 +72,18 @@ bool ScrollbarThemeOverlay::usesOverlayScrollbars() const {
return true;
}
+double ScrollbarThemeOverlay::overlayScrollbarFadeOutDelaySeconds() const {
+ WebThemeEngine::ScrollbarStyle style;
+ Platform::current()->themeEngine()->getOverlayScrollbarStyle(&style);
+ return style.fadeOutDelaySeconds;
+}
+
+double ScrollbarThemeOverlay::overlayScrollbarFadeOutDurationSeconds() const {
+ WebThemeEngine::ScrollbarStyle style;
+ Platform::current()->themeEngine()->getOverlayScrollbarStyle(&style);
+ return style.fadeOutDurationSeconds;
+}
+
int ScrollbarThemeOverlay::thumbPosition(const ScrollbarThemeClient& scrollbar,
float scrollPosition) {
if (!scrollbar.totalSize())
@@ -151,7 +163,10 @@ void ScrollbarThemeOverlay::paintThumb(GraphicsContext& context,
}
WebThemeEngine::State state = WebThemeEngine::StateNormal;
- if (scrollbar.pressedPart() == ThumbPart)
+
+ if (!scrollbar.enabled())
+ state = WebThemeEngine::StateDisabled;
+ else if (scrollbar.pressedPart() == ThumbPart)
state = WebThemeEngine::StatePressed;
else if (scrollbar.hoveredPart() == ThumbPart)
state = WebThemeEngine::StateHover;
@@ -177,7 +192,11 @@ ScrollbarPart ScrollbarThemeOverlay::hitTest(
if (m_allowHitTest == DisallowHitTest)
return NoPart;
- return ScrollbarTheme::hitTest(scrollbar, position);
+ ScrollbarPart part = ScrollbarTheme::hitTest(scrollbar, position);
+ if (part != ThumbPart)
+ return NoPart;
+
+ return ThumbPart;
}
ScrollbarThemeOverlay& ScrollbarThemeOverlay::mobileTheme() {

Powered by Google App Engine
This is Rietveld 408576698