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

Unified Diff: Source/platform/scroll/ScrollView.h

Issue 314583008: Refactor ScrollView::updateScrollbars() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: revised Created 6 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
« no previous file with comments | « no previous file | Source/platform/scroll/ScrollView.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scroll/ScrollView.h
diff --git a/Source/platform/scroll/ScrollView.h b/Source/platform/scroll/ScrollView.h
index 7037943e28c5cf21607bd158156281e82bf45aa7..0dbb995b7a681fa2cf0bbf89b937431e9ddbb550 100644
--- a/Source/platform/scroll/ScrollView.h
+++ b/Source/platform/scroll/ScrollView.h
@@ -120,8 +120,8 @@ public:
// included.
virtual IntRect visibleContentRect(IncludeScrollbarsInRect = ExcludeScrollbars) const OVERRIDE;
IntSize visibleSize() const { return visibleContentRect().size(); }
- virtual int visibleWidth() const OVERRIDE { return visibleContentRect().width(); }
- virtual int visibleHeight() const OVERRIDE { return visibleContentRect().height(); }
+ virtual int visibleWidth() const OVERRIDE FINAL { return visibleContentRect().width(); }
+ virtual int visibleHeight() const OVERRIDE FINAL { return visibleContentRect().height(); }
// visibleContentRect().size() is computed from unscaledVisibleContentSize() divided by the value of visibleContentScaleFactor.
// For the main frame, visibleContentScaleFactor is equal to the page's pageScaleFactor; it's 1 otherwise.
@@ -281,12 +281,21 @@ protected:
virtual bool isVerticalDocument() const { return true; }
virtual bool isFlippedDocument() const { return false; }
+ enum ComputeScrollbarExistenceOption {
+ FirstPass,
+ Incremental
+ };
+ void computeScrollbarExistence(bool& newHasHorizontalScrollbar, bool& newHasVerticalScrollbar, ComputeScrollbarExistenceOption = FirstPass) const;
+ void updateScrollbarGeometry();
+
// Called to update the scrollbars to accurately reflect the state of the view.
void updateScrollbars(const IntSize& desiredOffset);
IntSize excludeScrollbars(const IntSize&) const;
private:
+ bool adjustScrollbarExistence(ComputeScrollbarExistenceOption = FirstPass);
+
RefPtr<Scrollbar> m_horizontalScrollbar;
RefPtr<Scrollbar> m_verticalScrollbar;
ScrollbarMode m_horizontalScrollbarMode;
@@ -306,7 +315,6 @@ private:
bool m_scrollbarsSuppressed;
bool m_inUpdateScrollbars;
- unsigned m_updateScrollbarsPass;
IntPoint m_panScrollIconPoint;
bool m_drawPanScrollIcon;
« no previous file with comments | « no previous file | Source/platform/scroll/ScrollView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698