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

Unified Diff: Source/core/platform/ScrollableArea.h

Issue 16982005: Allow objects without scrollbars to be scrollable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Mac Build Fix Created 7 years, 6 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: Source/core/platform/ScrollableArea.h
diff --git a/Source/core/platform/ScrollableArea.h b/Source/core/platform/ScrollableArea.h
index a3cb10b3fb1aba567e696fa42dc4563b664934d8..2983fabd6d478b1fd7aa0210e2284221a7a6a6c0 100644
--- a/Source/core/platform/ScrollableArea.h
+++ b/Source/core/platform/ScrollableArea.h
@@ -132,7 +132,7 @@ public:
virtual Scrollbar* horizontalScrollbar() const { return 0; }
virtual Scrollbar* verticalScrollbar() const { return 0; }
- virtual IntPoint scrollPosition() const;
+ virtual IntPoint scrollPosition() const = 0;
virtual IntPoint minimumScrollPosition() const;
virtual IntPoint maximumScrollPosition() const;
@@ -175,6 +175,9 @@ public:
virtual void reportMemoryUsage(MemoryObjectInfo*) const;
+ virtual bool isHorizontallyScrollable() const = 0;
aelias_OOO_until_Jul13 2013/06/18 00:54:47 Instead of making each subclass implement this, ho
bokan 2013/06/18 23:03:27 The meaning of this method is more "is the object
aelias_OOO_until_Jul13 2013/06/19 02:55:24 So it really means scrollable by user input events
bokan 2013/06/19 18:57:00 Done.
+ virtual bool isVerticallyScrollable() const = 0;
+
// Convenience functions
int scrollPosition(ScrollbarOrientation orientation) { return orientation == HorizontalScrollbar ? scrollPosition().x() : scrollPosition().y(); }
int minimumScrollPosition(ScrollbarOrientation orientation) { return orientation == HorizontalScrollbar ? minimumScrollPosition().x() : minimumScrollPosition().y(); }
@@ -205,6 +208,8 @@ protected:
private:
void scrollPositionChanged(const IntPoint&);
+
+ bool isScrollable(ScrollbarOrientation orientation) const { return orientation == HorizontalScrollbar ? isHorizontallyScrollable() : isVerticallyScrollable(); }
// NOTE: Only called from the ScrollAnimator.
friend class ScrollAnimator;

Powered by Google App Engine
This is Rietveld 408576698