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

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

Issue 856443005: Delete some noop and dead scrollbar code. (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
« no previous file with comments | « sky/engine/platform/scroll/ScrollableArea.h ('k') | sky/engine/platform/scroll/Scrollbar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/platform/scroll/ScrollableArea.cpp
diff --git a/sky/engine/platform/scroll/ScrollableArea.cpp b/sky/engine/platform/scroll/ScrollableArea.cpp
index a4db72862d238dad26de5bb189e1d14eac0e9fd6..c650c48c710f6e2daf65ff54a42d7ec527988564 100644
--- a/sky/engine/platform/scroll/ScrollableArea.cpp
+++ b/sky/engine/platform/scroll/ScrollableArea.cpp
@@ -74,7 +74,6 @@ ScrollableArea::ScrollableArea()
: m_constrainsScrollingToContentEdge(true)
, m_verticalScrollElasticity(ScrollElasticityNone)
, m_horizontalScrollElasticity(ScrollElasticityNone)
- , m_scrollbarOverlayStyle(ScrollbarOverlayStyleDefault)
, m_scrollOriginChanged(false)
{
}
@@ -150,12 +149,6 @@ void ScrollableArea::scrollToOffsetWithoutAnimation(ScrollbarOrientation orienta
scrollToOffsetWithoutAnimation(FloatPoint(scrollAnimator()->currentPosition().x(), offset));
}
-void ScrollableArea::notifyScrollPositionChanged(const IntPoint& position)
-{
- scrollPositionChanged(position);
- scrollAnimator()->setCurrentPosition(position);
-}
-
void ScrollableArea::scrollPositionChanged(const IntPoint& position)
{
TRACE_EVENT0("blink", "ScrollableArea::scrollPositionChanged");
@@ -164,21 +157,11 @@ void ScrollableArea::scrollPositionChanged(const IntPoint& position)
// Tell the derived class to scroll its contents.
setScrollOffset(position);
- Scrollbar* verticalScrollbar = this->verticalScrollbar();
+ if (Scrollbar* scrollbar = this->horizontalScrollbar())
+ scrollbar->offsetDidChange();
- // Tell the scrollbars to update their thumb postions.
- if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) {
- horizontalScrollbar->offsetDidChange();
- if (horizontalScrollbar->isOverlayScrollbar()) {
- if (!verticalScrollbar)
- horizontalScrollbar->invalidate();
- }
- }
- if (verticalScrollbar) {
- verticalScrollbar->offsetDidChange();
- if (verticalScrollbar->isOverlayScrollbar())
- verticalScrollbar->invalidate();
- }
+ if (Scrollbar* scrollbar = this->verticalScrollbar())
+ scrollbar->offsetDidChange();
if (scrollPosition() != oldPosition)
scrollAnimator()->notifyContentAreaScrolled(scrollPosition() - oldPosition);
@@ -207,12 +190,6 @@ bool ScrollableArea::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
return scrollAnimator()->handleWheelEvent(wheelEvent);
}
-// NOTE: Only called from Internals for testing.
-void ScrollableArea::setScrollOffsetFromInternals(const IntPoint& offset)
-{
- setScrollOffsetFromAnimation(offset);
-}
-
void ScrollableArea::setScrollOffsetFromAnimation(const IntPoint& offset)
{
scrollPositionChanged(offset);
@@ -270,9 +247,6 @@ void ScrollableArea::didAddScrollbar(Scrollbar* scrollbar, ScrollbarOrientation
scrollAnimator()->didAddVerticalScrollbar(scrollbar);
else
scrollAnimator()->didAddHorizontalScrollbar(scrollbar);
-
- // <rdar://problem/9797253> AppKit resets the scrollbar's style when you attach a scrollbar
- setScrollbarOverlayStyle(scrollbarOverlayStyle());
}
void ScrollableArea::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation orientation)
@@ -298,19 +272,6 @@ bool ScrollableArea::hasOverlayScrollbars() const
return hScrollbar && hScrollbar->isOverlayScrollbar();
}
-void ScrollableArea::setScrollbarOverlayStyle(ScrollbarOverlayStyle overlayStyle)
-{
- m_scrollbarOverlayStyle = overlayStyle;
-
- if (Scrollbar* scrollbar = horizontalScrollbar()) {
- scrollbar->invalidate();
- }
-
- if (Scrollbar* scrollbar = verticalScrollbar()) {
- scrollbar->invalidate();
- }
-}
-
bool ScrollableArea::scheduleAnimation()
{
WTF_LOG(ScriptedAnimationController, "ScrollableArea::scheduleAnimation: window = %d",
« no previous file with comments | « sky/engine/platform/scroll/ScrollableArea.h ('k') | sky/engine/platform/scroll/Scrollbar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698