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

Unified Diff: third_party/WebKit/Source/platform/scroll/Scrollbar.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/Scrollbar.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
index 71273852b4c469c5fb9cd44d7b4113cf02a48fda..516eed533a8be643ee4b9a1c0b32f7df95180df5 100644
--- a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
+++ b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
@@ -462,12 +462,16 @@ void Scrollbar::mouseExited() {
}
void Scrollbar::mouseUp(const PlatformMouseEvent& mouseEvent) {
+ bool isCaptured = m_pressedPart == ThumbPart;
setPressedPart(NoPart);
m_pressedPos = 0;
m_draggingDocument = false;
stopTimerIfNeeded();
if (m_scrollableArea) {
+ if (isCaptured)
+ m_scrollableArea->mouseReleasedScrollbar();
+
// m_hoveredPart won't be updated until the next mouseMoved or mouseDown, so
// we have to hit test to really know if the mouse has exited the scrollbar
// on a mouseUp.
@@ -502,17 +506,20 @@ void Scrollbar::mouseDown(const PlatformMouseEvent& evt) {
moveThumb(desiredPos);
return;
}
- if (m_pressedPart == ThumbPart)
+ if (m_pressedPart == ThumbPart) {
m_dragOrigin = m_currentPos;
+ if (m_scrollableArea)
+ m_scrollableArea->mouseCapturedScrollbar();
+ }
m_pressedPos = pressedPos;
autoscrollPressedPart(theme().initialAutoscrollTimerDelay());
}
-void Scrollbar::visibilityChanged() {
+void Scrollbar::setScrollbarsHidden(bool hidden) {
if (m_scrollableArea)
- m_scrollableArea->scrollbarVisibilityChanged();
+ m_scrollableArea->setScrollbarsHidden(hidden);
}
void Scrollbar::setEnabled(bool e) {
@@ -538,8 +545,7 @@ bool Scrollbar::shouldParticipateInHitTesting() {
// Non-overlay scrollbars should always participate in hit testing.
if (!isOverlayScrollbar())
return true;
- return m_scrollableArea->scrollAnimator()
- .shouldScrollbarParticipateInHitTesting(*this);
+ return !m_scrollableArea->scrollbarsHidden();
}
bool Scrollbar::isWindowActive() const {
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/Scrollbar.h ('k') | third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698