Chromium Code Reviews| Index: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp |
| diff --git a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp |
| index 0e1681ef3de8de68557b632c4ba6cd0f38871993..0d4f9f209b37894fdc03c233fb202aec0e0ebb88 100644 |
| --- a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp |
| +++ b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp |
| @@ -37,6 +37,9 @@ |
| #include "platform/scroll/MainThreadScrollingReason.h" |
| #include "platform/scroll/ProgrammaticScrollAnimator.h" |
| #include "platform/scroll/ScrollbarTheme.h" |
| +#include "public/platform/Platform.h" |
| +#include "public/platform/WebScheduler.h" |
| +#include "public/platform/WebThread.h" |
| static const int kPixelsPerLineStep = 40; |
| static const float kMinFractionToStepWhenPaging = 0.875f; |
| @@ -577,8 +580,9 @@ void ScrollableArea::showOverlayScrollbars() { |
| return; |
| if (!m_fadeOverlayScrollbarsTimer) { |
| - m_fadeOverlayScrollbarsTimer.reset(new Timer<ScrollableArea>( |
| - this, &ScrollableArea::fadeOverlayScrollbarsTimerFired)); |
| + m_fadeOverlayScrollbarsTimer.reset(new TaskRunnerTimer<ScrollableArea>( |
| + getTimerTaskRunner(), this, |
| + &ScrollableArea::fadeOverlayScrollbarsTimerFired)); |
| } |
| if (!m_scrollbarCaptured && !m_mouseOverScrollbar) { |
| @@ -657,6 +661,12 @@ FloatQuad ScrollableArea::localToVisibleContentQuad(const FloatQuad& quad, |
| return result; |
| } |
| +RefPtr<WebTaskRunner> ScrollableArea::getTimerTaskRunner() const { |
|
haraken
2017/01/20 05:45:51
I'd prefer making this a pure virtual method and o
jbroman
2017/01/20 15:55:17
Done.
|
| + WebThread* thread = Platform::current()->mainThread(); |
| + DCHECK(thread->isCurrentThread()); |
| + return thread->scheduler()->timerTaskRunner(); |
| +} |
| + |
| IntSize ScrollableArea::excludeScrollbars(const IntSize& size) const { |
| return IntSize(std::max(0, size.width() - verticalScrollbarWidth()), |
| std::max(0, size.height() - horizontalScrollbarHeight())); |