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

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

Issue 14703004: Reland "Unifies ScrollView and RenderLayer to use non-shi..." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 7 years, 7 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 | « Source/core/platform/ScrollView.cpp ('k') | Source/core/platform/Scrollbar.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/ScrollableArea.h
diff --git a/Source/core/platform/ScrollableArea.h b/Source/core/platform/ScrollableArea.h
index 5ba8c9e67888f603299f7d4b135cbb416a488b70..4b0b7b6654f9b27757e0a1910e78b97ba03960b0 100644
--- a/Source/core/platform/ScrollableArea.h
+++ b/Source/core/platform/ScrollableArea.h
@@ -174,6 +174,12 @@ public:
virtual void reportMemoryUsage(MemoryObjectInfo*) const;
+ // Convenience functions
+ int scrollPosition(ScrollbarOrientation orientation) { return orientation == HorizontalScrollbar ? scrollPosition().x() : scrollPosition().y(); }
+ int minimumScrollPosition(ScrollbarOrientation orientation) { return orientation == HorizontalScrollbar ? minimumScrollPosition().x() : minimumScrollPosition().y(); }
+ int maximumScrollPosition(ScrollbarOrientation orientation) { return orientation == HorizontalScrollbar ? maximumScrollPosition().x() : maximumScrollPosition().y(); }
+ int clampScrollPosition(ScrollbarOrientation orientation, int pos) { return std::max(std::min(pos, maximumScrollPosition(orientation)), minimumScrollPosition(orientation)); }
+
protected:
ScrollableArea();
virtual ~ScrollableArea();
« no previous file with comments | « Source/core/platform/ScrollView.cpp ('k') | Source/core/platform/Scrollbar.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698