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 720713003: Remove WebScroll* (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 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
« no previous file with comments | « sky/engine/platform/scroll/Scrollbar.h ('k') | sky/engine/public/BUILD.gn » ('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 d33be8715b76d50db9bfb70e27aedb6956e743f4..70dcab6e032ef5cfb7c8ab3b1294ac15856a4298 100644
--- a/sky/engine/platform/scroll/Scrollbar.cpp
+++ b/sky/engine/platform/scroll/Scrollbar.cpp
@@ -35,7 +35,6 @@
#include "public/platform/Platform.h"
#include "public/platform/WebPoint.h"
#include "public/platform/WebRect.h"
-#include "public/platform/WebScrollbarBehavior.h"
#include "public/platform/WebThemeEngine.h"
// The position of the scrollbar thumb affects the appearance of the steppers, so
@@ -323,14 +322,9 @@ bool Scrollbar::gestureEvent(const PlatformGestureEvent& evt)
void Scrollbar::mouseMoved(const PlatformMouseEvent& evt)
{
if (m_pressedPart == ThumbPart) {
- if (shouldSnapBackToDragOrigin(evt)) {
- if (m_scrollableArea)
- m_scrollableArea->scrollToOffsetWithoutAnimation(m_orientation, m_dragOrigin + m_scrollableArea->minimumScrollPosition(m_orientation));
- } else {
- moveThumb(m_orientation == HorizontalScrollbar ?
- convertFromContainingView(evt.position()).x() :
- convertFromContainingView(evt.position()).y());
- }
+ moveThumb(m_orientation == HorizontalScrollbar ?
+ convertFromContainingView(evt.position()).x() :
+ convertFromContainingView(evt.position()).y());
return;
}
@@ -396,18 +390,7 @@ void Scrollbar::mouseDown(const PlatformMouseEvent& evt)
setPressedPart(NoPart);
int pressedPos = orientation() == HorizontalScrollbar ? convertFromContainingView(evt.position()).x() : convertFromContainingView(evt.position()).y();
- if ((m_pressedPart == BackTrackPart || m_pressedPart == ForwardTrackPart) && shouldCenterOnThumb(evt)) {
- setHoveredPart(ThumbPart);
- setPressedPart(ThumbPart);
- m_dragOrigin = m_currentPos;
- int thumbLen = thumbLength();
- int desiredPos = pressedPos;
- // Set the pressed position to the middle of the thumb so that when we do the move, the delta
- // will be from the current pixel position of the thumb to the new desired position for the thumb.
- m_pressedPos = trackPosition() + thumbPosition() + thumbLen / 2;
- moveThumb(desiredPos);
- return;
- } else if (m_pressedPart == ThumbPart)
+ if (m_pressedPart == ThumbPart)
m_dragOrigin = m_currentPos;
m_pressedPos = pressedPos;
@@ -511,18 +494,6 @@ void Scrollbar::invalidatePart(ScrollbarPart part)
invalidateRect(result);
}
-bool Scrollbar::shouldCenterOnThumb(const PlatformMouseEvent& evt)
-{
- return blink::Platform::current()->scrollbarBehavior()->shouldCenterOnThumb(static_cast<blink::WebScrollbarBehavior::Button>(evt.button()), evt.shiftKey(), evt.altKey());
-}
-
-bool Scrollbar::shouldSnapBackToDragOrigin(const PlatformMouseEvent& evt)
-{
- IntPoint mousePosition = convertFromContainingView(evt.position());
- mousePosition.move(x(), y());
- return blink::Platform::current()->scrollbarBehavior()->shouldSnapBackToDragOrigin(mousePosition, trackRect(), orientation() == HorizontalScrollbar);
-}
-
int Scrollbar::thumbPosition()
{
if (!totalSize())
« no previous file with comments | « sky/engine/platform/scroll/Scrollbar.h ('k') | sky/engine/public/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698