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

Unified Diff: sky/engine/platform/scroll/Scrollbar.cpp

Issue 873963003: Remove more mouse-specific code (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Build fixes Created 5 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
« no previous file with comments | « sky/engine/platform/scroll/Scrollbar.h ('k') | sky/engine/public/web/WebViewClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/platform/scroll/Scrollbar.cpp
diff --git a/sky/engine/platform/scroll/Scrollbar.cpp b/sky/engine/platform/scroll/Scrollbar.cpp
index de65c077d3733950fd088b312799686dcdfa7418..72ebd85d7fd3245d1adedad3d2781c0f50bf9632 100644
--- a/sky/engine/platform/scroll/Scrollbar.cpp
+++ b/sky/engine/platform/scroll/Scrollbar.cpp
@@ -130,25 +130,12 @@ void Scrollbar::autoscrollTimerFired(Timer<Scrollbar>*)
autoscrollPressedPart(autoscrollTimerDelay());
}
-static bool thumbUnderMouse(Scrollbar* scrollbar)
-{
- int thumbPos = scrollbar->trackPosition() + scrollbar->thumbPosition();
- int thumbLength = scrollbar->thumbLength();
- return scrollbar->pressedPos() >= thumbPos && scrollbar->pressedPos() < thumbPos + thumbLength;
-}
-
void Scrollbar::autoscrollPressedPart(double delay)
{
// Don't do anything for the thumb or if nothing was pressed.
if (m_pressedPart == ThumbPart || m_pressedPart == NoPart)
return;
- // Handle the track.
- if ((m_pressedPart == BackTrackPart || m_pressedPart == ForwardTrackPart) && thumbUnderMouse(this)) {
- setHoveredPart(ThumbPart);
- return;
- }
-
// Handle the arrows and track.
if (m_scrollableArea && m_scrollableArea->scroll(pressedPartScrollDirection(), pressedPartScrollGranularity()))
startTimerIfNeeded(delay);
@@ -160,13 +147,6 @@ void Scrollbar::startTimerIfNeeded(double delay)
if (m_pressedPart == ThumbPart)
return;
- // Handle the track. We halt track scrolling once the thumb is level
- // with us.
- if ((m_pressedPart == BackTrackPart || m_pressedPart == ForwardTrackPart) && thumbUnderMouse(this)) {
- setHoveredPart(ThumbPart);
- return;
- }
-
// We can't scroll if we've hit the beginning or end.
ScrollDirection dir = pressedPartScrollDirection();
if (dir == ScrollUp || dir == ScrollLeft) {
@@ -241,19 +221,6 @@ void Scrollbar::setPressedPart(ScrollbarPart part)
m_pressedPart = part;
}
-void Scrollbar::mouseEntered()
-{
- if (m_scrollableArea)
- m_scrollableArea->mouseEnteredScrollbar(this);
-}
-
-void Scrollbar::mouseExited()
-{
- if (m_scrollableArea)
- m_scrollableArea->mouseExitedScrollbar(this);
- setHoveredPart(NoPart);
-}
-
bool Scrollbar::isOverlayScrollbar() const
{
// FIXME(sky): Remove
« no previous file with comments | « sky/engine/platform/scroll/Scrollbar.h ('k') | sky/engine/public/web/WebViewClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698