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

Unified Diff: Source/core/platform/ScrollView.cpp

Issue 26936002: Remove Widget's dependency upon its own inheritor aka ScrollView. This was nasty from an OO design… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Fix for clang compile error Created 7 years, 2 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.h ('k') | Source/core/platform/Scrollbar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/ScrollView.cpp
diff --git a/Source/core/platform/ScrollView.cpp b/Source/core/platform/ScrollView.cpp
index 011bdf3a47d1943a92eb117bd5bf3daecf03007b..21456c8ae219c7764379b20004bbcebe547fc980 100644
--- a/Source/core/platform/ScrollView.cpp
+++ b/Source/core/platform/ScrollView.cpp
@@ -645,7 +645,7 @@ void ScrollView::adjustScrollbarsAvoidingResizerCount(int overlapDelta)
int oldCount = m_scrollbarsAvoidingResizer;
m_scrollbarsAvoidingResizer += overlapDelta;
if (parent())
- parent()->adjustScrollbarsAvoidingResizerCount(overlapDelta);
+ toScrollView(parent())->adjustScrollbarsAvoidingResizerCount(overlapDelta);
else if (!scrollbarsSuppressed()) {
// If we went from n to 0 or from 0 to n and we're the outermost view,
// we need to invalidate the windowResizerRect(), since it will now need to paint
@@ -656,18 +656,18 @@ void ScrollView::adjustScrollbarsAvoidingResizerCount(int overlapDelta)
}
}
-void ScrollView::setParent(ScrollView* parentView)
+void ScrollView::setParent(Widget* parentView)
{
if (parentView == parent())
return;
if (m_scrollbarsAvoidingResizer && parent())
- parent()->adjustScrollbarsAvoidingResizerCount(-m_scrollbarsAvoidingResizer);
+ toScrollView(parent())->adjustScrollbarsAvoidingResizerCount(-m_scrollbarsAvoidingResizer);
Widget::setParent(parentView);
if (m_scrollbarsAvoidingResizer && parent())
- parent()->adjustScrollbarsAvoidingResizerCount(m_scrollbarsAvoidingResizer);
+ toScrollView(parent())->adjustScrollbarsAvoidingResizerCount(m_scrollbarsAvoidingResizer);
}
void ScrollView::setScrollbarsSuppressed(bool suppressed, bool repaintOnUnsuppress)
@@ -866,7 +866,7 @@ void ScrollView::paintPanScrollIcon(GraphicsContext* context)
static Image* panScrollIcon = Image::loadPlatformResource("panIcon").leakRef();
IntPoint iconGCPoint = m_panScrollIconPoint;
if (parent())
- iconGCPoint = parent()->windowToContents(iconGCPoint);
+ iconGCPoint = toScrollView(parent())->windowToContents(iconGCPoint);
context->drawImage(panScrollIcon, iconGCPoint);
}
« no previous file with comments | « Source/core/platform/ScrollView.h ('k') | Source/core/platform/Scrollbar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698