| 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 838c8e3f314f346598e67d1281c898a969e5406e..2d4b06e0b8b4871964320f7a39ba093fe31fdf02 100644
|
| --- a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
|
| +++ b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
|
| @@ -44,6 +44,19 @@
|
|
|
| namespace blink {
|
|
|
| +struct SameSizeAsScrollableArea {
|
| + virtual ~SameSizeAsScrollableArea();
|
| +#if ENABLE(ASSERT)
|
| + VerifyEagerFinalization verifyEager;
|
| +#endif
|
| + Member<void*> pointer[2];
|
| + unsigned bitfields : 17;
|
| + IntPoint origin;
|
| +};
|
| +
|
| +static_assert(sizeof(ScrollableArea) == sizeof(SameSizeAsScrollableArea),
|
| + "ScrollableArea should stay small");
|
| +
|
| int ScrollableArea::pixelsPerLineStep(HostWindow* host) {
|
| if (!host)
|
| return kPixelsPerLineStep;
|
| @@ -66,20 +79,17 @@
|
| m_horizontalScrollbarNeedsPaintInvalidation(false),
|
| m_verticalScrollbarNeedsPaintInvalidation(false),
|
| m_scrollCornerNeedsPaintInvalidation(false),
|
| - m_scrollbarsHidden(false),
|
| - m_scrollbarCaptured(false) {}
|
| + m_scrollbarsHidden(false) {}
|
|
|
| ScrollableArea::~ScrollableArea() {}
|
|
|
| -void ScrollableArea::clearScrollableArea() {
|
| +void ScrollableArea::clearScrollAnimators() {
|
| #if OS(MACOSX)
|
| if (m_scrollAnimator)
|
| m_scrollAnimator->dispose();
|
| #endif
|
| m_scrollAnimator.clear();
|
| m_programmaticScrollAnimator.clear();
|
| - if (m_fadeOverlayScrollbarsTimer)
|
| - m_fadeOverlayScrollbarsTimer->stop();
|
| }
|
|
|
| ScrollAnimatorBase& ScrollableArea::scrollAnimator() const {
|
| @@ -322,27 +332,12 @@
|
| scrollAnimator->mouseMovedInContentArea();
|
| }
|
|
|
| -void ScrollableArea::mouseEnteredScrollbar(Scrollbar& scrollbar) {
|
| +void ScrollableArea::mouseEnteredScrollbar(Scrollbar& scrollbar) const {
|
| scrollAnimator().mouseEnteredScrollbar(scrollbar);
|
| - // Restart the fade out timer.
|
| - showOverlayScrollbars();
|
| -}
|
| -
|
| -void ScrollableArea::mouseExitedScrollbar(Scrollbar& scrollbar) {
|
| +}
|
| +
|
| +void ScrollableArea::mouseExitedScrollbar(Scrollbar& scrollbar) const {
|
| scrollAnimator().mouseExitedScrollbar(scrollbar);
|
| -}
|
| -
|
| -void ScrollableArea::mouseCapturedScrollbar() {
|
| - m_scrollbarCaptured = true;
|
| - showOverlayScrollbars();
|
| - if (m_fadeOverlayScrollbarsTimer)
|
| - m_fadeOverlayScrollbarsTimer->stop();
|
| -}
|
| -
|
| -void ScrollableArea::mouseReleasedScrollbar() {
|
| - m_scrollbarCaptured = false;
|
| - // This will kick off the fade out timer.
|
| - showOverlayScrollbars();
|
| }
|
|
|
| void ScrollableArea::contentAreaDidShow() const {
|
| @@ -383,7 +378,6 @@
|
| }
|
|
|
| void ScrollableArea::contentsResized() {
|
| - showOverlayScrollbars();
|
| if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator())
|
| scrollAnimator->contentsResized();
|
| }
|
| @@ -544,40 +538,8 @@
|
| void ScrollableArea::setScrollbarsHidden(bool hidden) {
|
| if (m_scrollbarsHidden == static_cast<unsigned>(hidden))
|
| return;
|
| -
|
| m_scrollbarsHidden = hidden;
|
| - scrollbarVisibilityChanged();
|
| -}
|
| -
|
| -void ScrollableArea::fadeOverlayScrollbarsTimerFired(TimerBase*) {
|
| - setScrollbarsHidden(true);
|
| -}
|
| -
|
| -void ScrollableArea::showOverlayScrollbars() {
|
| - if (!ScrollbarTheme::theme().usesOverlayScrollbars())
|
| - return;
|
| -
|
| - setScrollbarsHidden(false);
|
| -
|
| - const double timeUntilDisable =
|
| - ScrollbarTheme::theme().overlayScrollbarFadeOutDelaySeconds() +
|
| - ScrollbarTheme::theme().overlayScrollbarFadeOutDurationSeconds();
|
| -
|
| - // If the overlay scrollbars don't fade out, don't do anything. This is the
|
| - // case for the mock overlays used in tests and on Mac, where the fade-out is
|
| - // animated in ScrollAnimatorMac.
|
| - if (!timeUntilDisable)
|
| - return;
|
| -
|
| - if (!m_fadeOverlayScrollbarsTimer) {
|
| - m_fadeOverlayScrollbarsTimer.reset(new Timer<ScrollableArea>(
|
| - this, &ScrollableArea::fadeOverlayScrollbarsTimerFired));
|
| - }
|
| -
|
| - if (!m_scrollbarCaptured) {
|
| - m_fadeOverlayScrollbarsTimer->startOneShot(timeUntilDisable,
|
| - BLINK_FROM_HERE);
|
| - }
|
| + didChangeScrollbarsHidden();
|
| }
|
|
|
| IntRect ScrollableArea::visibleContentRect(
|
|
|