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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp

Issue 2478463003: Revert of Implement overlay scrollbar fade out for non-composited scrollers. (Closed)
Patch Set: Created 4 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
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 0b3fc1a545382631c9d4b4993a3e165bcfa2e098..ae5d8e41f19e34536c1bda4be73988007efa3e4e 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(
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollableArea.h ('k') | third_party/WebKit/Source/platform/scroll/Scrollbar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698