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

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

Issue 870073003: Remove mouse events from Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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
Index: sky/engine/platform/scroll/Scrollbar.cpp
diff --git a/sky/engine/platform/scroll/Scrollbar.cpp b/sky/engine/platform/scroll/Scrollbar.cpp
index d08cdb29f85eb3bb45fa935ed3f7f00c2f1224a3..6942f888a7fa45d88b4f334c3790e4a163d9d8af 100644
--- a/sky/engine/platform/scroll/Scrollbar.cpp
+++ b/sky/engine/platform/scroll/Scrollbar.cpp
@@ -27,7 +27,6 @@
#include "sky/engine/platform/scroll/Scrollbar.h"
#include "sky/engine/platform/PlatformGestureEvent.h"
-#include "sky/engine/platform/PlatformMouseEvent.h"
#include "sky/engine/platform/graphics/GraphicsContext.h"
#include "sky/engine/platform/scroll/ScrollAnimator.h"
#include "sky/engine/platform/scroll/ScrollableArea.h"
@@ -287,39 +286,6 @@ bool Scrollbar::gestureEvent(const PlatformGestureEvent& evt)
}
}
-void Scrollbar::mouseMoved(const PlatformMouseEvent& evt)
-{
- if (m_pressedPart == ThumbPart) {
- moveThumb(m_orientation == HorizontalScrollbar ?
- convertFromContainingView(evt.position()).x() :
- convertFromContainingView(evt.position()).y());
- return;
- }
-
- if (m_pressedPart != NoPart)
- m_pressedPos = orientation() == HorizontalScrollbar ? convertFromContainingView(evt.position()).x() : convertFromContainingView(evt.position()).y();
-
- // FIXME(sky): Cleanup this code now that part is always NoPart.
- ScrollbarPart part = NoPart;
- if (part != m_hoveredPart) {
- if (m_pressedPart != NoPart) {
- if (part == m_pressedPart) {
- // The mouse is moving back over the pressed part. We
- // need to start up the timer action again.
- startTimerIfNeeded(autoscrollTimerDelay());
- } else if (m_hoveredPart == m_pressedPart) {
- // The mouse is leaving the pressed part. Kill our timer
- // if needed.
- stopTimerIfNeeded();
- }
- }
-
- setHoveredPart(part);
- }
-
- return;
-}
-
void Scrollbar::mouseEntered()
{
if (m_scrollableArea)
@@ -333,37 +299,6 @@ void Scrollbar::mouseExited()
setHoveredPart(NoPart);
}
-void Scrollbar::mouseUp(const PlatformMouseEvent& mouseEvent)
-{
- setPressedPart(NoPart);
- m_pressedPos = 0;
- stopTimerIfNeeded();
-
- if (m_scrollableArea) {
- // 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.
- m_scrollableArea->mouseExitedScrollbar(this);
- }
-}
-
-void Scrollbar::mouseDown(const PlatformMouseEvent& evt)
-{
- // Early exit for right click
- if (evt.button() == RightButton)
- return;
-
- // FIXME(sky): Do we still need setPressedPart now that we only set it to NoPart?
- setPressedPart(NoPart);
- int pressedPos = orientation() == HorizontalScrollbar ? convertFromContainingView(evt.position()).x() : convertFromContainingView(evt.position()).y();
-
- if (m_pressedPart == ThumbPart)
- m_dragOrigin = m_currentPos;
-
- m_pressedPos = pressedPos;
-
- autoscrollPressedPart(initialAutoscrollTimerDelay());
-}
-
bool Scrollbar::isOverlayScrollbar() const
{
// FIXME(sky): Remove

Powered by Google App Engine
This is Rietveld 408576698