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

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

Issue 684353002: Remove more stuff from Widget. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 25c57a6f3c1820e3db30dfdbf0a0efb819fb8e08..fad195010ac3cd2650879ad776ed2dee6d6833f0 100644
--- a/sky/engine/platform/scroll/Scrollbar.cpp
+++ b/sky/engine/platform/scroll/Scrollbar.cpp
@@ -284,7 +284,7 @@ bool Scrollbar::gestureEvent(const PlatformGestureEvent& evt)
case PlatformEvent::GestureTapDown:
// FIXME(sky): Is setting the pressed part needed since we only have overlay scrollbars?
setPressedPart(NoPart);
- m_pressedPos = orientation() == HorizontalScrollbar ? convertFromContainingWindow(evt.position()).x() : convertFromContainingWindow(evt.position()).y();
+ m_pressedPos = orientation() == HorizontalScrollbar ? convertFromContainingView(evt.position()).x() : convertFromContainingView(evt.position()).y();
return true;
case PlatformEvent::GestureTapDownCancel:
case PlatformEvent::GestureScrollBegin:
@@ -330,14 +330,14 @@ void Scrollbar::mouseMoved(const PlatformMouseEvent& evt)
m_scrollableArea->scrollToOffsetWithoutAnimation(m_orientation, m_dragOrigin + m_scrollableArea->minimumScrollPosition(m_orientation));
} else {
moveThumb(m_orientation == HorizontalScrollbar ?
- convertFromContainingWindow(evt.position()).x() :
- convertFromContainingWindow(evt.position()).y());
+ convertFromContainingView(evt.position()).x() :
+ convertFromContainingView(evt.position()).y());
}
return;
}
if (m_pressedPart != NoPart)
- m_pressedPos = orientation() == HorizontalScrollbar ? convertFromContainingWindow(evt.position()).x() : convertFromContainingWindow(evt.position()).y();
+ 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;
@@ -396,7 +396,7 @@ void Scrollbar::mouseDown(const PlatformMouseEvent& evt)
// FIXME(sky): Do we still need setPressedPart now that we only set it to NoPart?
setPressedPart(NoPart);
- int pressedPos = orientation() == HorizontalScrollbar ? convertFromContainingWindow(evt.position()).x() : convertFromContainingWindow(evt.position()).y();
+ int pressedPos = orientation() == HorizontalScrollbar ? convertFromContainingView(evt.position()).x() : convertFromContainingView(evt.position()).y();
if ((m_pressedPart == BackTrackPart || m_pressedPart == ForwardTrackPart) && shouldCenterOnThumb(evt)) {
setHoveredPart(ThumbPart);
@@ -527,7 +527,7 @@ bool Scrollbar::shouldCenterOnThumb(const PlatformMouseEvent& evt)
bool Scrollbar::shouldSnapBackToDragOrigin(const PlatformMouseEvent& evt)
{
- IntPoint mousePosition = convertFromContainingWindow(evt.position());
+ IntPoint mousePosition = convertFromContainingView(evt.position());
mousePosition.move(x(), y());
return blink::Platform::current()->scrollbarBehavior()->shouldSnapBackToDragOrigin(mousePosition, trackRect(), orientation() == HorizontalScrollbar);
}

Powered by Google App Engine
This is Rietveld 408576698