Part 2 of "Cleanup Scrollbar/ScrollbarClient relationship"
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Jan 2011 20:15:04 +0000 (20:15 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Jan 2011 20:15:04 +0000 (20:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=52779

Reviewed by Anders Carlsson.

Rename ScrollbarClient -> ScrollableArea.

Source/WebCore:

- Also replaces Scrollbar::setClient with Scrollbar::disconnectFromScrollableArea
  since that was its only use case.

* CMakeLists.txt:
* GNUmakefile.am:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AccessibilityScrollbar.cpp:
(WebCore::AccessibilityScrollbar::setValue):
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::SelectorChecker::checkScrollbarPseudoClass):
* page/FrameView.h:
* platform/PopupMenuClient.h:
* platform/ScrollAnimator.cpp:
(WebCore::ScrollAnimator::create):
(WebCore::ScrollAnimator::ScrollAnimator):
(WebCore::ScrollAnimator::scroll):
(WebCore::ScrollAnimator::notityPositionChanged):
* platform/ScrollAnimator.h:
* platform/ScrollAnimatorWin.cpp:
(WebCore::ScrollAnimator::create):
(WebCore::ScrollAnimatorWin::ScrollAnimatorWin):
(WebCore::ScrollAnimatorWin::scroll):
* platform/ScrollAnimatorWin.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::scroll):
(WebCore::ScrollView::updateScrollbars):
(WebCore::ScrollView::wheelEvent):
* platform/ScrollView.h:
* platform/ScrollableArea.cpp: Copied from WebCore/platform/ScrollbarClient.cpp.
(WebCore::ScrollableArea::ScrollableArea):
(WebCore::ScrollableArea::~ScrollableArea):
(WebCore::ScrollableArea::scroll):
(WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):
(WebCore::ScrollableArea::scrollToXOffsetWithoutAnimation):
(WebCore::ScrollableArea::scrollToYOffsetWithoutAnimation):
(WebCore::ScrollableArea::setScrollOffsetFromAnimation):
* platform/ScrollableArea.h: Copied from WebCore/platform/ScrollbarClient.h.
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::createNativeScrollbar):
(WebCore::Scrollbar::Scrollbar):
(WebCore::Scrollbar::offsetDidChange):
(WebCore::Scrollbar::autoscrollPressedPart):
(WebCore::Scrollbar::moveThumb):
(WebCore::Scrollbar::mouseMoved):
(WebCore::Scrollbar::isWindowActive):
(WebCore::Scrollbar::invalidateRect):
(WebCore::Scrollbar::convertToContainingView):
(WebCore::Scrollbar::convertFromContainingView):
* platform/Scrollbar.h:
(WebCore::Scrollbar::disconnectFromScrollableArea):
(WebCore::Scrollbar::scrollableArea):
* platform/ScrollbarClient.cpp: Removed.
* platform/ScrollbarClient.h: Removed.
* platform/ScrollbarThemeComposite.cpp:
* platform/chromium/FramelessScrollView.h:
* platform/chromium/ScrollbarThemeChromium.cpp:
(WebCore::ScrollbarThemeChromium::paintTickmarks):
* platform/efl/ScrollbarEfl.cpp:
(Scrollbar::createNativeScrollbar):
(ScrollbarEfl::ScrollbarEfl):
(scrollbarEflEdjeMessage):
* platform/efl/ScrollbarEfl.h:
* platform/gtk/MainFrameScrollbarGtk.cpp:
(MainFrameScrollbarGtk::create):
(MainFrameScrollbarGtk::MainFrameScrollbarGtk):
(MainFrameScrollbarGtk::gtkValueChanged):
* platform/gtk/MainFrameScrollbarGtk.h:
* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimator::create):
(WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
(WebCore::ScrollAnimatorMac::scroll):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::paint):
* platform/qt/ScrollbarQt.cpp:
(WebCore::Scrollbar::contextMenu):
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::scrollToRevealSelection):
(WebCore::PopupMenuWin::wndProc):
* platform/win/PopupMenuWin.h:
* platform/win/ScrollbarThemeSafari.cpp:
(WebCore::ScrollbarThemeSafari::paintTrackBackground):
(WebCore::ScrollbarThemeSafari::paintButton):
(WebCore::ScrollbarThemeSafari::paintThumb):
* platform/wx/ScrollbarThemeWx.cpp:
(WebCore::ScrollbarThemeWx::paint):
* rendering/RenderDataGrid.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollToOffset):
(WebCore::RenderLayer::destroyScrollbar):
(WebCore::RenderLayer::scroll):
* rendering/RenderLayer.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::scrollToRevealElementAtListIndex):
(WebCore::RenderListBox::scroll):
(WebCore::RenderListBox::logicalScroll):
(WebCore::RenderListBox::setScrollTop):
(WebCore::RenderListBox::destroyScrollbar):
* rendering/RenderListBox.h:
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::createScrollbar):
* rendering/RenderMenuList.h:
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::createCustomScrollbar):
(WebCore::RenderScrollbar::RenderScrollbar):
* rendering/RenderScrollbar.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::createScrollbar):
* rendering/RenderTextControlSingleLine.h:

Source/WebKit/chromium:

* src/AutoFillPopupMenuClient.cpp:
(WebKit::AutoFillPopupMenuClient::createScrollbar):
* src/AutoFillPopupMenuClient.h:
* src/WebScrollbarImpl.cpp:
(WebKit::WebScrollbarImpl::WebScrollbarImpl):
(WebKit::WebScrollbarImpl::scroll):
(WebKit::WebScrollbarImpl::onMouseWheel):
(WebKit::WebScrollbarImpl::onKeyDown):
* src/WebScrollbarImpl.h:
* tests/PopupMenuTest.cpp:
(WebKit::TestPopupMenuClient::createScrollbar):

Source/WebKit/qt:

* Api/qwebframe.cpp:
(QWebFrame::setScrollBarValue):

Source/WebKit/win:

* WebScrollBar.cpp:
(WebScrollBar::scroll):
* WebScrollBar.h:

Source/WebKit2:

* UIProcess/win/WebPopupMenuProxyWin.cpp:
(WebKit::WebPopupMenuProxyWin::onMouseWheel):
(WebKit::WebPopupMenuProxyWin::scrollToRevealSelection):
* UIProcess/win/WebPopupMenuProxyWin.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76378 268f45cc-cd09-0410-ab3c-d52691b4dbfc

61 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.am
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.pro
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/accessibility/AccessibilityScrollbar.cpp
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/platform/PopupMenuClient.h
Source/WebCore/platform/ScrollAnimator.cpp
Source/WebCore/platform/ScrollAnimator.h
Source/WebCore/platform/ScrollAnimatorWin.cpp
Source/WebCore/platform/ScrollAnimatorWin.h
Source/WebCore/platform/ScrollView.cpp
Source/WebCore/platform/ScrollView.h
Source/WebCore/platform/ScrollableArea.cpp [moved from Source/WebCore/platform/ScrollbarClient.cpp with 83% similarity]
Source/WebCore/platform/ScrollableArea.h [moved from Source/WebCore/platform/ScrollbarClient.h with 94% similarity]
Source/WebCore/platform/Scrollbar.cpp
Source/WebCore/platform/Scrollbar.h
Source/WebCore/platform/ScrollbarThemeComposite.cpp
Source/WebCore/platform/chromium/FramelessScrollView.h
Source/WebCore/platform/chromium/ScrollbarThemeChromium.cpp
Source/WebCore/platform/efl/ScrollbarEfl.cpp
Source/WebCore/platform/efl/ScrollbarEfl.h
Source/WebCore/platform/gtk/MainFrameScrollbarGtk.cpp
Source/WebCore/platform/gtk/MainFrameScrollbarGtk.h
Source/WebCore/platform/mac/ScrollAnimatorMac.h
Source/WebCore/platform/mac/ScrollAnimatorMac.mm
Source/WebCore/platform/mac/ScrollbarThemeMac.mm
Source/WebCore/platform/qt/ScrollbarQt.cpp
Source/WebCore/platform/win/PopupMenuWin.cpp
Source/WebCore/platform/win/PopupMenuWin.h
Source/WebCore/platform/win/ScrollbarThemeSafari.cpp
Source/WebCore/platform/wx/ScrollbarThemeWx.cpp
Source/WebCore/rendering/RenderDataGrid.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/rendering/RenderListBox.h
Source/WebCore/rendering/RenderMenuList.cpp
Source/WebCore/rendering/RenderMenuList.h
Source/WebCore/rendering/RenderScrollbar.cpp
Source/WebCore/rendering/RenderScrollbar.h
Source/WebCore/rendering/RenderTextControlSingleLine.cpp
Source/WebCore/rendering/RenderTextControlSingleLine.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
Source/WebKit/chromium/src/AutoFillPopupMenuClient.h
Source/WebKit/chromium/src/WebScrollbarImpl.cpp
Source/WebKit/chromium/src/WebScrollbarImpl.h
Source/WebKit/chromium/tests/PopupMenuTest.cpp
Source/WebKit/qt/Api/qwebframe.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebScrollBar.cpp
Source/WebKit/win/WebScrollBar.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp
Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.h

index 272c66d..95d8790 100644 (file)
@@ -1311,8 +1311,8 @@ SET(WebCore_SOURCES
     platform/Logging.cpp
     platform/MIMETypeRegistry.cpp
     platform/ScrollAnimator.cpp
+    platform/ScrollableArea.cpp
     platform/Scrollbar.cpp
-    platform/ScrollbarClient.cpp
     platform/ScrollbarThemeComposite.cpp
     platform/ScrollView.cpp
     platform/SharedBuffer.cpp
index 65d7a5e..a5ca3e2 100644 (file)
@@ -1,3 +1,125 @@
+2011-01-21  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        Part 2 of "Cleanup Scrollbar/ScrollbarClient relationship"
+        https://bugs.webkit.org/show_bug.cgi?id=52779
+
+        Rename ScrollbarClient -> ScrollableArea.
+
+        - Also replaces Scrollbar::setClient with Scrollbar::disconnectFromScrollableArea
+          since that was its only use case.
+
+        * CMakeLists.txt:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * accessibility/AccessibilityScrollbar.cpp:
+        (WebCore::AccessibilityScrollbar::setValue):
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::SelectorChecker::checkScrollbarPseudoClass):
+        * page/FrameView.h:
+        * platform/PopupMenuClient.h:
+        * platform/ScrollAnimator.cpp:
+        (WebCore::ScrollAnimator::create):
+        (WebCore::ScrollAnimator::ScrollAnimator):
+        (WebCore::ScrollAnimator::scroll):
+        (WebCore::ScrollAnimator::notityPositionChanged):
+        * platform/ScrollAnimator.h:
+        * platform/ScrollAnimatorWin.cpp:
+        (WebCore::ScrollAnimator::create):
+        (WebCore::ScrollAnimatorWin::ScrollAnimatorWin):
+        (WebCore::ScrollAnimatorWin::scroll):
+        * platform/ScrollAnimatorWin.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::scroll):
+        (WebCore::ScrollView::updateScrollbars):
+        (WebCore::ScrollView::wheelEvent):
+        * platform/ScrollView.h:
+        * platform/ScrollableArea.cpp: Copied from WebCore/platform/ScrollbarClient.cpp.
+        (WebCore::ScrollableArea::ScrollableArea):
+        (WebCore::ScrollableArea::~ScrollableArea):
+        (WebCore::ScrollableArea::scroll):
+        (WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):
+        (WebCore::ScrollableArea::scrollToXOffsetWithoutAnimation):
+        (WebCore::ScrollableArea::scrollToYOffsetWithoutAnimation):
+        (WebCore::ScrollableArea::setScrollOffsetFromAnimation):
+        * platform/ScrollableArea.h: Copied from WebCore/platform/ScrollbarClient.h.
+        * platform/Scrollbar.cpp:
+        (WebCore::Scrollbar::createNativeScrollbar):
+        (WebCore::Scrollbar::Scrollbar):
+        (WebCore::Scrollbar::offsetDidChange):
+        (WebCore::Scrollbar::autoscrollPressedPart):
+        (WebCore::Scrollbar::moveThumb):
+        (WebCore::Scrollbar::mouseMoved):
+        (WebCore::Scrollbar::isWindowActive):
+        (WebCore::Scrollbar::invalidateRect):
+        (WebCore::Scrollbar::convertToContainingView):
+        (WebCore::Scrollbar::convertFromContainingView):
+        * platform/Scrollbar.h:
+        (WebCore::Scrollbar::disconnectFromScrollableArea):
+        (WebCore::Scrollbar::scrollableArea):
+        * platform/ScrollbarClient.cpp: Removed.
+        * platform/ScrollbarClient.h: Removed.
+        * platform/ScrollbarThemeComposite.cpp:
+        * platform/chromium/FramelessScrollView.h:
+        * platform/chromium/ScrollbarThemeChromium.cpp:
+        (WebCore::ScrollbarThemeChromium::paintTickmarks):
+        * platform/efl/ScrollbarEfl.cpp:
+        (Scrollbar::createNativeScrollbar):
+        (ScrollbarEfl::ScrollbarEfl):
+        (scrollbarEflEdjeMessage):
+        * platform/efl/ScrollbarEfl.h:
+        * platform/gtk/MainFrameScrollbarGtk.cpp:
+        (MainFrameScrollbarGtk::create):
+        (MainFrameScrollbarGtk::MainFrameScrollbarGtk):
+        (MainFrameScrollbarGtk::gtkValueChanged):
+        * platform/gtk/MainFrameScrollbarGtk.h:
+        * platform/mac/ScrollAnimatorMac.h:
+        * platform/mac/ScrollAnimatorMac.mm:
+        (WebCore::ScrollAnimator::create):
+        (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
+        (WebCore::ScrollAnimatorMac::scroll):
+        * platform/mac/ScrollbarThemeMac.mm:
+        (WebCore::ScrollbarThemeMac::paint):
+        * platform/qt/ScrollbarQt.cpp:
+        (WebCore::Scrollbar::contextMenu):
+        * platform/win/PopupMenuWin.cpp:
+        (WebCore::PopupMenuWin::scrollToRevealSelection):
+        (WebCore::PopupMenuWin::wndProc):
+        * platform/win/PopupMenuWin.h:
+        * platform/win/ScrollbarThemeSafari.cpp:
+        (WebCore::ScrollbarThemeSafari::paintTrackBackground):
+        (WebCore::ScrollbarThemeSafari::paintButton):
+        (WebCore::ScrollbarThemeSafari::paintThumb):
+        * platform/wx/ScrollbarThemeWx.cpp:
+        (WebCore::ScrollbarThemeWx::paint):
+        * rendering/RenderDataGrid.h:
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::scrollToOffset):
+        (WebCore::RenderLayer::destroyScrollbar):
+        (WebCore::RenderLayer::scroll):
+        * rendering/RenderLayer.h:
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::scrollToRevealElementAtListIndex):
+        (WebCore::RenderListBox::scroll):
+        (WebCore::RenderListBox::logicalScroll):
+        (WebCore::RenderListBox::setScrollTop):
+        (WebCore::RenderListBox::destroyScrollbar):
+        * rendering/RenderListBox.h:
+        * rendering/RenderMenuList.cpp:
+        (WebCore::RenderMenuList::createScrollbar):
+        * rendering/RenderMenuList.h:
+        * rendering/RenderScrollbar.cpp:
+        (WebCore::RenderScrollbar::createCustomScrollbar):
+        (WebCore::RenderScrollbar::RenderScrollbar):
+        * rendering/RenderScrollbar.h:
+        * rendering/RenderTextControlSingleLine.cpp:
+        (WebCore::RenderTextControlSingleLine::createScrollbar):
+        * rendering/RenderTextControlSingleLine.h:
+
 2011-01-21  Darin Adler  <darin@apple.com>
 
         Fix Leopard build.
index 19c3179..0975094 100644 (file)
@@ -2574,8 +2574,8 @@ webcore_sources += \
        Source/WebCore/platform/SchemeRegistry.h \
        Source/WebCore/platform/ScrollAnimator.cpp \
        Source/WebCore/platform/ScrollAnimator.h \
-       Source/WebCore/platform/ScrollbarClient.cpp \
-       Source/WebCore/platform/ScrollbarClient.h \
+       Source/WebCore/platform/ScrollableArea.cpp \
+       Source/WebCore/platform/ScrollableArea.h \
        Source/WebCore/platform/Scrollbar.cpp \
        Source/WebCore/platform/Scrollbar.h \
        Source/WebCore/platform/ScrollbarThemeComposite.cpp \
index 0348c06..ca3ab04 100644 (file)
             'platform/ScrollView.h',
             'platform/SchemeRegistry.cpp',
             'platform/SchemeRegistry.h',
+            'platform/ScrollableArea.cpp',
+            'platform/ScrollableArea.h',
             'platform/Scrollbar.cpp',
             'platform/Scrollbar.h',
-            'platform/ScrollbarClient.cpp',
-            'platform/ScrollbarClient.h',
             'platform/ScrollbarTheme.h',
             'platform/ScrollbarThemeComposite.cpp',
             'platform/ScrollbarThemeComposite.h',
index ff1072a..7b953f3 100644 (file)
@@ -1255,9 +1255,9 @@ SOURCES += \
     platform/network/ResourceResponseBase.cpp \
     platform/text/RegularExpression.cpp \
     platform/SchemeRegistry.cpp \
+    platform/ScrollableArea.cpp \
     platform/ScrollAnimator.cpp \
     platform/Scrollbar.cpp \
-    platform/ScrollbarClient.cpp \
     platform/ScrollbarThemeComposite.cpp \
     platform/ScrollView.cpp \
     platform/text/SegmentedString.cpp \
@@ -2194,9 +2194,9 @@ HEADERS += \
     platform/qt/QtStyleOptionWebComboBox.h \
     platform/qt/RenderThemeQt.h \
     platform/qt/ScrollbarThemeQt.h \
+    platform/ScrollableArea.h \
     platform/ScrollAnimator.h \
     platform/Scrollbar.h \
-    platform/ScrollbarClient.h \
     platform/ScrollbarThemeComposite.h \
     platform/ScrollView.h \
     platform/SearchPopupMenu.h \
index 009c8ea..f1da922 100755 (executable)
                                >
                        </File>
                        <File
-                               RelativePath="..\platform\Scrollbar.cpp"
+                               RelativePath="..\platform\ScrollableArea.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\platform\Scrollbar.h"
+                               RelativePath="..\platform\ScrollableArea.h"
                                >
                        </File>
                        <File
-                               RelativePath="..\platform\ScrollbarClient.cpp"
+                               RelativePath="..\platform\Scrollbar.cpp"
                                >
                        </File>
                        <File
-                               RelativePath="..\platform\ScrollbarClient.h"
+                               RelativePath="..\platform\Scrollbar.h"
                                >
                        </File>
                        <File
index 8f86edf..4f01530 100644 (file)
                BC82432A0D0CE8A200460C8F /* JSSQLTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8243260D0CE8A200460C8F /* JSSQLTransaction.h */; };
                BC8243E80D0CFD7500460C8F /* WindowFeatures.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8243E60D0CFD7500460C8F /* WindowFeatures.cpp */; };
                BC8243E90D0CFD7500460C8F /* WindowFeatures.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8243E70D0CFD7500460C8F /* WindowFeatures.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               BC8AE34E12EA096A00EB3AE6 /* ScrollableArea.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8AE34C12EA096A00EB3AE6 /* ScrollableArea.cpp */; };
+               BC8AE34F12EA096A00EB3AE6 /* ScrollableArea.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8AE34D12EA096A00EB3AE6 /* ScrollableArea.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC8B853E0E7C7F1100AB6984 /* ScrollbarThemeMac.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8B853C0E7C7F1100AB6984 /* ScrollbarThemeMac.h */; };
                BC8B854B0E7C7F5600AB6984 /* ScrollbarTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8B854A0E7C7F5600AB6984 /* ScrollbarTheme.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC8BF151105813BF00A40A07 /* UserStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8BF150105813BF00A40A07 /* UserStyleSheet.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC99812E0DBE807A008CE9EF /* DOMAbstractViewFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = BC99812D0DBE807A008CE9EF /* DOMAbstractViewFrame.h */; };
                BC9ADD230CC4032600098C4C /* WebKitCSSTransformValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9ADD220CC4032600098C4C /* WebKitCSSTransformValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC9ADD800CC4092200098C4C /* WebKitCSSTransformValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC9ADD7F0CC4092200098C4C /* WebKitCSSTransformValue.cpp */; };
-               BC9BC64D0E7C4889008B9849 /* ScrollbarClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC9BC64B0E7C4889008B9849 /* ScrollbarClient.cpp */; settings = {ATTRIBUTES = (Private, ); }; };
-               BC9BC64E0E7C4889008B9849 /* ScrollbarClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9BC64C0E7C4889008B9849 /* ScrollbarClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BCA169A20BFD55B40019CA76 /* JSHTMLTableCaptionElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA169A00BFD55B40019CA76 /* JSHTMLTableCaptionElement.cpp */; };
                BCA169A30BFD55B40019CA76 /* JSHTMLTableCaptionElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA169A10BFD55B40019CA76 /* JSHTMLTableCaptionElement.h */; };
                BCA257151293C010007A263D /* VerticalPositionCache.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA257141293C010007A263D /* VerticalPositionCache.h */; };
                BC8243260D0CE8A200460C8F /* JSSQLTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLTransaction.h; sourceTree = "<group>"; };
                BC8243E60D0CFD7500460C8F /* WindowFeatures.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowFeatures.cpp; sourceTree = "<group>"; };
                BC8243E70D0CFD7500460C8F /* WindowFeatures.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowFeatures.h; sourceTree = "<group>"; };
+               BC8AE34C12EA096A00EB3AE6 /* ScrollableArea.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollableArea.cpp; sourceTree = "<group>"; };
+               BC8AE34D12EA096A00EB3AE6 /* ScrollableArea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollableArea.h; sourceTree = "<group>"; };
                BC8B853C0E7C7F1100AB6984 /* ScrollbarThemeMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollbarThemeMac.h; sourceTree = "<group>"; };
                BC8B854A0E7C7F5600AB6984 /* ScrollbarTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollbarTheme.h; sourceTree = "<group>"; };
                BC8BF150105813BF00A40A07 /* UserStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserStyleSheet.h; sourceTree = "<group>"; };
                BC99812D0DBE807A008CE9EF /* DOMAbstractViewFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMAbstractViewFrame.h; sourceTree = "<group>"; };
                BC9ADD220CC4032600098C4C /* WebKitCSSTransformValue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebKitCSSTransformValue.h; sourceTree = "<group>"; };
                BC9ADD7F0CC4092200098C4C /* WebKitCSSTransformValue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSTransformValue.cpp; sourceTree = "<group>"; };
-               BC9BC64B0E7C4889008B9849 /* ScrollbarClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollbarClient.cpp; sourceTree = "<group>"; };
-               BC9BC64C0E7C4889008B9849 /* ScrollbarClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollbarClient.h; sourceTree = "<group>"; };
                BCA169A00BFD55B40019CA76 /* JSHTMLTableCaptionElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLTableCaptionElement.cpp; sourceTree = "<group>"; };
                BCA169A10BFD55B40019CA76 /* JSHTMLTableCaptionElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLTableCaptionElement.h; sourceTree = "<group>"; };
                BCA257141293C010007A263D /* VerticalPositionCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VerticalPositionCache.h; sourceTree = "<group>"; };
                                1C63A2460F71646600C09D5A /* RunLoopTimer.h */,
                                5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */,
                                5162C7F311F77EFB00612EFE /* SchemeRegistry.h */,
+                               BC8AE34C12EA096A00EB3AE6 /* ScrollableArea.cpp */,
+                               BC8AE34D12EA096A00EB3AE6 /* ScrollableArea.h */,
                                CA3BF67B10D99BAE00E6CE53 /* ScrollAnimator.cpp */,
                                CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */,
                                BCAA90C20A7EBA60008B1229 /* Scrollbar.cpp */,
                                BC7B2AF80450824100A8000F /* Scrollbar.h */,
-                               BC9BC64B0E7C4889008B9849 /* ScrollbarClient.cpp */,
-                               BC9BC64C0E7C4889008B9849 /* ScrollbarClient.h */,
                                BC8B854A0E7C7F5600AB6984 /* ScrollbarTheme.h */,
                                BC1402880E83680800319717 /* ScrollbarThemeComposite.cpp */,
                                BC1402890E83680800319717 /* ScrollbarThemeComposite.h */,
                                CA3BF67E10D99BAE00E6CE53 /* ScrollAnimator.h in Headers */,
                                BCAE1FA712939DB7004CB026 /* ScrollAnimatorMac.h in Headers */,
                                93F199B808245E59001E9ABC /* Scrollbar.h in Headers */,
-                               BC9BC64E0E7C4889008B9849 /* ScrollbarClient.h in Headers */,
                                BC8B854B0E7C7F5600AB6984 /* ScrollbarTheme.h in Headers */,
                                BC14028B0E83680800319717 /* ScrollbarThemeComposite.h in Headers */,
                                BC8B853E0E7C7F1100AB6984 /* ScrollbarThemeMac.h in Headers */,
                                93F199ED08245E59001E9ABC /* XSLTProcessor.h in Headers */,
                                E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
                                97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
+                               BC8AE34F12EA096A00EB3AE6 /* ScrollableArea.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                CA3BF67C10D99BAE00E6CE53 /* ScrollAnimator.cpp in Sources */,
                                BC51156E12B1749C00C96754 /* ScrollAnimatorMac.mm in Sources */,
                                BCAA90C30A7EBA60008B1229 /* Scrollbar.cpp in Sources */,
-                               BC9BC64D0E7C4889008B9849 /* ScrollbarClient.cpp in Sources */,
                                BC14028A0E83680800319717 /* ScrollbarThemeComposite.cpp in Sources */,
                                BCEF869F0E844E9D00A85CD5 /* ScrollbarThemeMac.mm in Sources */,
                                5D925B670F64D4DD00B847F0 /* ScrollBehavior.cpp in Sources */,
                                93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */,
                                E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
                                97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
+                               BC8AE34E12EA096A00EB3AE6 /* ScrollableArea.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index b261a46..b225af8 100644 (file)
@@ -97,11 +97,11 @@ void AccessibilityScrollbar::setValue(float value)
     if (!m_scrollbar)
         return;
     
-    if (!m_scrollbar->client())
+    if (!m_scrollbar->scrollableArea())
         return;
 
     float newValue = value * m_scrollbar->maximum();
-    m_scrollbar->client()->scrollToOffsetWithoutAnimation(m_scrollbar->orientation(), newValue);
+    m_scrollbar->scrollableArea()->scrollToOffsetWithoutAnimation(m_scrollbar->orientation(), newValue);
 }
     
 } // namespace WebCore
index 27b44d2..63090cf 100644 (file)
@@ -2867,7 +2867,7 @@ bool CSSStyleSelector::SelectorChecker::checkScrollbarPseudoClass(CSSSelector* s
             return false;
         }
         case CSSSelector::PseudoCornerPresent:
-            return scrollbar->client()->scrollbarCornerPresent();
+            return scrollbar->scrollableArea()->scrollbarCornerPresent();
         default:
             return false;
     }
index 174619d..8491f5c 100644 (file)
@@ -294,7 +294,7 @@ private:
     virtual IntPoint convertToContainingView(const IntPoint&) const;
     virtual IntPoint convertFromContainingView(const IntPoint&) const;
 
-    // ScrollBarClient interface
+    // ScrollableArea interface
     virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&);
     virtual bool isActive() const;
     virtual void getTickmarks(Vector<IntRect>&) const;
index 45912a1..f33b9e2 100644 (file)
@@ -32,7 +32,7 @@ class Color;
 class FontSelector;
 class HostWindow;
 class Scrollbar;
-class ScrollbarClient;
+class ScrollableArea;
 
 class PopupMenuClient {
 public:
@@ -66,7 +66,7 @@ public:
     virtual FontSelector* fontSelector() const = 0;
     virtual HostWindow* hostWindow() const = 0;
 
-    virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize) = 0;
+    virtual PassRefPtr<Scrollbar> createScrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize) = 0;
 };
 
 #if ENABLE(NO_LISTBOX_RENDERING)
index 5873e88..9def297 100644 (file)
 #include "ScrollAnimator.h"
 
 #include "FloatPoint.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
 #include <algorithm>
+#include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 
 #if !ENABLE(SMOOTH_SCROLLING)
-ScrollAnimator* ScrollAnimator::create(ScrollbarClient* client)
+PassOwnPtr<ScrollAnimator> ScrollAnimator::create(ScrollableArea* scrollableArea)
 {
-    return new ScrollAnimator(client);
+    return adoptPtr(new ScrollAnimator(scrollableArea));
 }
 #endif
 
-ScrollAnimator::ScrollAnimator(ScrollbarClient* client)
-    : m_client(client)
+ScrollAnimator::ScrollAnimator(ScrollableArea* scrollableArea)
+    : m_scrollableArea(scrollableArea)
     , m_currentPosX(0)
     , m_currentPosY(0)
 {
@@ -58,7 +59,7 @@ ScrollAnimator::~ScrollAnimator()
 bool ScrollAnimator::scroll(ScrollbarOrientation orientation, ScrollGranularity, float step, float multiplier)
 {
     float* currentPos = (orientation == HorizontalScrollbar) ? &m_currentPosX : &m_currentPosY;
-    float newPos = std::max(std::min(*currentPos + (step * multiplier), static_cast<float>(m_client->scrollSize(orientation))), 0.0f);
+    float newPos = std::max(std::min(*currentPos + (step * multiplier), static_cast<float>(m_scrollableArea->scrollSize(orientation))), 0.0f);
     if (*currentPos == newPos)
         return false;
     *currentPos = newPos;
@@ -82,7 +83,7 @@ FloatPoint ScrollAnimator::currentPosition() const
 
 void ScrollAnimator::notityPositionChanged()
 {
-    m_client->setScrollOffsetFromAnimation(IntPoint(m_currentPosX, m_currentPosY));
+    m_scrollableArea->setScrollOffsetFromAnimation(IntPoint(m_currentPosX, m_currentPosY));
 }
 
 } // namespace WebCore
index 553ceee..155c6e5 100644 (file)
 #define ScrollAnimator_h
 
 #include "ScrollTypes.h"
+#include <wtf/Forward.h>
 
 namespace WebCore {
 
 class FloatPoint;
-class ScrollbarClient;
+class ScrollableArea;
 
 class ScrollAnimator {
 public:
-    static ScrollAnimator* create(ScrollbarClient*);
+    static PassOwnPtr<ScrollAnimator> create(ScrollableArea*);
 
-    ScrollAnimator(ScrollbarClient* client);
     virtual ~ScrollAnimator();
 
     // Computes a scroll destination for the given parameters.  Returns false if
@@ -56,9 +56,11 @@ public:
     FloatPoint currentPosition() const;
 
 protected:
+    ScrollAnimator(ScrollableArea*);
+
     void notityPositionChanged();
 
-    ScrollbarClient* m_client;
+    ScrollableArea* m_scrollableArea;
     float m_currentPosX; // We avoid using a FloatPoint in order to reduce
     float m_currentPosY; // subclass code complexity.
 };
index cdbfb94..47a00cb 100644 (file)
 #include "ScrollAnimatorWin.h"
 
 #include "FloatPoint.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
 #include "ScrollbarTheme.h"
 #include <algorithm>
 #include <wtf/CurrentTime.h>
+#include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 
-// static
-ScrollAnimator* ScrollAnimator::create(ScrollbarClient* client)
+PassOwnPtr<ScrollAnimator> ScrollAnimator::create(ScrollableArea* scrollableArea)
 {
-    return new ScrollAnimatorWin(client);
+    return adoptPtr(new ScrollAnimatorWin(scrollableArea));
 }
 
 const double ScrollAnimatorWin::animationTimerDelay = 0.01;
@@ -61,8 +61,8 @@ ScrollAnimatorWin::PerAxisData::PerAxisData(ScrollAnimatorWin* parent, float* cu
 }
 
 
-ScrollAnimatorWin::ScrollAnimatorWin(ScrollbarClient* client)
-    : ScrollAnimator(client)
+ScrollAnimatorWin::ScrollAnimatorWin(ScrollableArea* scrollableArea)
+    : ScrollAnimator(scrollableArea)
     , m_horizontalData(this, &m_currentPosX)
     , m_verticalData(this, &m_currentPosY)
 {
@@ -82,7 +82,7 @@ bool ScrollAnimatorWin::scroll(ScrollbarOrientation orientation, ScrollGranulari
 
     // This is an animatable scroll.  Calculate the scroll delta.
     PerAxisData* data = (orientation == VerticalScrollbar) ? &m_verticalData : &m_horizontalData;
-    float newPos = std::max(std::min(data->m_desiredPos + (step * multiplier), static_cast<float>(m_client->scrollSize(orientation))), 0.0f);
+    float newPos = std::max(std::min(data->m_desiredPos + (step * multiplier), static_cast<float>(m_scrollableArea->scrollSize(orientation))), 0.0f);
     if (newPos == data->m_desiredPos)
         return false;
     data->m_desiredPos = newPos;
index ef421f3..6f87e58 100644 (file)
@@ -40,7 +40,7 @@ namespace WebCore {
 
 class ScrollAnimatorWin : public ScrollAnimator {
 public:
-    ScrollAnimatorWin(ScrollbarClient*);
+    ScrollAnimatorWin(ScrollableArea*);
     virtual ~ScrollAnimatorWin();
 
     virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float step, float multiplier);
index 1010b15..cc2a09e 100644 (file)
@@ -387,7 +387,7 @@ bool ScrollView::scroll(ScrollDirection direction, ScrollGranularity granularity
     if (platformWidget())
         return platformScroll(direction, granularity);
 
-    return ScrollbarClient::scroll(direction, granularity);
+    return ScrollableArea::scroll(direction, granularity);
 }
 
 bool ScrollView::logicalScroll(ScrollLogicalDirection direction, ScrollGranularity granularity)
@@ -548,7 +548,7 @@ void ScrollView::updateScrollbars(const IntSize& desiredOffset)
         updateScrollCorner();
     }
 
-    ScrollbarClient::scrollToOffsetWithoutAnimation(FloatPoint(scroll.width() + m_scrollOrigin.x(), scroll.height() + m_scrollOrigin.y()));
+    ScrollableArea::scrollToOffsetWithoutAnimation(FloatPoint(scroll.width() + m_scrollOrigin.x(), scroll.height() + m_scrollOrigin.y()));
 
     m_inUpdateScrollbars = false;
 }
@@ -752,9 +752,9 @@ void ScrollView::wheelEvent(PlatformWheelEvent& e)
         }
 
         if (deltaY)
-            ScrollbarClient::scroll(ScrollUp, ScrollByPixel, deltaY);
+            ScrollableArea::scroll(ScrollUp, ScrollByPixel, deltaY);
         if (deltaX)
-            ScrollbarClient::scroll(ScrollLeft, ScrollByPixel, deltaX);
+            ScrollableArea::scroll(ScrollLeft, ScrollByPixel, deltaX);
     }
 }
 
index 00e8bf8..a70624d 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "IntRect.h"
 #include "Scrollbar.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
 #include "ScrollTypes.h"
 #include "Widget.h"
 
@@ -54,16 +54,16 @@ class HostWindow;
 class PlatformWheelEvent;
 class Scrollbar;
 
-class ScrollView : public Widget, public ScrollbarClient {
+class ScrollView : public Widget, public ScrollableArea {
 public:
     ~ScrollView();
 
-    // ScrollbarClient functions.  FrameView overrides the others.
+    // ScrollableArea functions.  FrameView overrides the others.
     virtual int scrollSize(ScrollbarOrientation orientation) const;
     virtual int scrollPosition(Scrollbar*) const;
     virtual void setScrollOffset(const IntPoint&);
     
-    // NOTE: This should only be called by the overriden setScrollOffset from ScrollbarClient.
+    // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
     virtual void scrollTo(const IntSize& newOffset);
 
     // The window thats hosts the ScrollView. The ScrollView will communicate scrolls and repaints to the
similarity index 83%
rename from Source/WebCore/platform/ScrollbarClient.cpp
rename to Source/WebCore/platform/ScrollableArea.cpp
index d8529b4..176cb7e 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2010, Google Inc. All rights reserved.
+ * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  */
 
 #include "config.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
 
 #include "FloatPoint.h"
 #include "PlatformWheelEvent.h"
 #include "ScrollAnimator.h"
+#include <wtf/PassOwnPtr.h>
 
 namespace WebCore {
 
-ScrollbarClient::ScrollbarClient()
+ScrollableArea::ScrollableArea()
     : m_scrollAnimator(ScrollAnimator::create(this))
 {
 }
 
-ScrollbarClient::~ScrollbarClient()
+ScrollableArea::~ScrollableArea()
 {
 }
 
-bool ScrollbarClient::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
+bool ScrollableArea::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
 {
     ScrollbarOrientation orientation;
     Scrollbar* scrollbar;
@@ -83,12 +85,12 @@ bool ScrollbarClient::scroll(ScrollDirection direction, ScrollGranularity granul
     return m_scrollAnimator->scroll(orientation, granularity, step, multiplier);
 }
 
-void ScrollbarClient::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
+void ScrollableArea::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
 {
     m_scrollAnimator->scrollToOffsetWithoutAnimation(offset);
 }
 
-void ScrollbarClient::scrollToOffsetWithoutAnimation(ScrollbarOrientation orientation, float offset)
+void ScrollableArea::scrollToOffsetWithoutAnimation(ScrollbarOrientation orientation, float offset)
 {
     if (orientation == HorizontalScrollbar)
         scrollToXOffsetWithoutAnimation(offset);
@@ -96,17 +98,17 @@ void ScrollbarClient::scrollToOffsetWithoutAnimation(ScrollbarOrientation orient
         scrollToYOffsetWithoutAnimation(offset);
 }
 
-void ScrollbarClient::scrollToXOffsetWithoutAnimation(float x)
+void ScrollableArea::scrollToXOffsetWithoutAnimation(float x)
 {
     scrollToOffsetWithoutAnimation(FloatPoint(x, m_scrollAnimator->currentPosition().y()));
 }
 
-void ScrollbarClient::scrollToYOffsetWithoutAnimation(float y)
+void ScrollableArea::scrollToYOffsetWithoutAnimation(float y)
 {
     scrollToOffsetWithoutAnimation(FloatPoint(m_scrollAnimator->currentPosition().x(), y));
 }
 
-void ScrollbarClient::setScrollOffsetFromAnimation(const IntPoint& offset)
+void ScrollableArea::setScrollOffsetFromAnimation(const IntPoint& offset)
 {
     // Tell the derived class to scroll its contents.
     setScrollOffset(offset);
similarity index 94%
rename from Source/WebCore/platform/ScrollbarClient.h
rename to Source/WebCore/platform/ScrollableArea.h
index 4abd51e..148ecdb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -23,8 +23,8 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef ScrollbarClient_h
-#define ScrollbarClient_h
+#ifndef ScrollableArea_h
+#define ScrollableArea_h
 
 #include "IntRect.h"
 #include "Scrollbar.h"
@@ -36,10 +36,10 @@ class FloatPoint;
 class PlatformWheelEvent;
 class ScrollAnimator;
 
-class ScrollbarClient {
+class ScrollableArea {
 public:
-    ScrollbarClient();
-    virtual ~ScrollbarClient();
+    ScrollableArea();
+    virtual ~ScrollableArea();
 
     bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
     void scrollToOffsetWithoutAnimation(const FloatPoint&);
@@ -92,4 +92,4 @@ private:
 
 } // namespace WebCore
 
-#endif // ScrollbarClient_h
+#endif // ScrollableArea_h
index 377186d..4c625f4 100644 (file)
 #include "config.h"
 #include "Scrollbar.h"
 
-#include "AccessibilityScrollbar.h"
 #include "AXObjectCache.h"
+#include "AccessibilityScrollbar.h"
 #include "EventHandler.h"
 #include "Frame.h"
 #include "FrameView.h"
 #include "GraphicsContext.h"
 #include "PlatformMouseEvent.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
 #include "ScrollbarTheme.h"
 
 #include <algorithm>
@@ -49,9 +49,9 @@ using namespace std;
 namespace WebCore {
 
 #if !PLATFORM(EFL)
-PassRefPtr<Scrollbar> Scrollbar::createNativeScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size)
+PassRefPtr<Scrollbar> Scrollbar::createNativeScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize size)
 {
-    return adoptRef(new Scrollbar(client, orientation, size));
+    return adoptRef(new Scrollbar(scrollableArea, orientation, size));
 }
 #endif
 
@@ -61,9 +61,9 @@ int Scrollbar::maxOverlapBetweenPages()
     return maxOverlapBetweenPages;
 }
 
-Scrollbar::Scrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize controlSize,
+Scrollbar::Scrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize,
                      ScrollbarTheme* theme)
-    : m_client(client)
+    : m_scrollableArea(scrollableArea)
     , m_orientation(orientation)
     , m_controlSize(controlSize)
     , m_theme(theme)
@@ -106,9 +106,9 @@ Scrollbar::~Scrollbar()
 
 void Scrollbar::offsetDidChange()
 {
-    ASSERT(m_client);
+    ASSERT(m_scrollableArea);
 
-    float position = static_cast<float>(m_client->scrollPosition(this));
+    float position = static_cast<float>(m_scrollableArea->scrollPosition(this));
     if (position == m_currentPos)
         return;
 
@@ -196,7 +196,7 @@ void Scrollbar::autoscrollPressedPart(double delay)
     }
 
     // Handle the arrows and track.
-    if (client()->scroll(pressedPartScrollDirection(), pressedPartScrollGranularity()))
+    if (scrollableArea()->scroll(pressedPartScrollDirection(), pressedPartScrollGranularity()))
         startTimerIfNeeded(delay);
 }
 
@@ -268,7 +268,7 @@ void Scrollbar::moveThumb(int pos)
     
     if (delta) {
         float newPosition = static_cast<float>(thumbPos + delta) * maximum() / (trackLen - thumbLen);
-        client()->scrollToOffsetWithoutAnimation(m_orientation, newPosition);
+        scrollableArea()->scrollToOffsetWithoutAnimation(m_orientation, newPosition);
     }
 }
 
@@ -301,7 +301,7 @@ bool Scrollbar::mouseMoved(const PlatformMouseEvent& evt)
 {
     if (m_pressedPart == ThumbPart) {
         if (theme()->shouldSnapBackToDragOrigin(this, evt))
-            client()->scrollToOffsetWithoutAnimation(m_orientation, m_dragOrigin);
+            scrollableArea()->scrollToOffsetWithoutAnimation(m_orientation, m_dragOrigin);
         else {
             moveThumb(m_orientation == HorizontalScrollbar ? 
                       convertFromContainingWindow(evt.pos()).x() :
@@ -433,7 +433,7 @@ void Scrollbar::setEnabled(bool e)
 
 bool Scrollbar::isWindowActive() const
 {
-    return m_client && m_client->isActive();
+    return m_scrollableArea && m_scrollableArea->isActive();
 }
     
 AXObjectCache* Scrollbar::axObjectCache() const
@@ -449,38 +449,38 @@ void Scrollbar::invalidateRect(const IntRect& rect)
 {
     if (suppressInvalidation())
         return;
-    if (m_client)
-        m_client->invalidateScrollbarRect(this, rect);
+    if (m_scrollableArea)
+        m_scrollableArea->invalidateScrollbarRect(this, rect);
 }
 
 IntRect Scrollbar::convertToContainingView(const IntRect& localRect) const
 {
-    if (m_client)
-        return m_client->convertFromScrollbarToContainingView(this, localRect);
+    if (m_scrollableArea)
+        return m_scrollableArea->convertFromScrollbarToContainingView(this, localRect);
 
     return Widget::convertToContainingView(localRect);
 }
 
 IntRect Scrollbar::convertFromContainingView(const IntRect& parentRect) const
 {
-    if (m_client)
-        return m_client->convertFromContainingViewToScrollbar(this, parentRect);
+    if (m_scrollableArea)
+        return m_scrollableArea->convertFromContainingViewToScrollbar(this, parentRect);
 
     return Widget::convertFromContainingView(parentRect);
 }
 
 IntPoint Scrollbar::convertToContainingView(const IntPoint& localPoint) const
 {
-    if (m_client)
-        return m_client->convertFromScrollbarToContainingView(this, localPoint);
+    if (m_scrollableArea)
+        return m_scrollableArea->convertFromScrollbarToContainingView(this, localPoint);
 
     return Widget::convertToContainingView(localPoint);
 }
 
 IntPoint Scrollbar::convertFromContainingView(const IntPoint& parentPoint) const
 {
-    if (m_client)
-        return m_client->convertFromContainingViewToScrollbar(this, parentPoint);
+    if (m_scrollableArea)
+        return m_scrollableArea->convertFromContainingViewToScrollbar(this, parentPoint);
 
     return Widget::convertFromContainingView(parentPoint);
 }
index 869aef2..5db191a 100644 (file)
@@ -36,31 +36,26 @@ namespace WebCore {
 
 class GraphicsContext;
 class IntRect;
-class ScrollbarClient;
-class ScrollbarTheme;
 class PlatformMouseEvent;
+class ScrollableArea;
+class ScrollbarTheme;
 
 class Scrollbar : public Widget {
 public:
-    enum ScrollSource {
-        FromScrollAnimator,
-        NotFromScrollAnimator,
-    };
+    // Must be implemented by platforms that can't simply use the Scrollbar base class.  Right now the only platform that is not using the base class is GTK.
+    static PassRefPtr<Scrollbar> createNativeScrollbar(ScrollableArea*, ScrollbarOrientation orientation, ScrollbarControlSize size);
 
     virtual ~Scrollbar();
 
-    // Must be implemented by platforms that can't simply use the Scrollbar base class.  Right now the only platform that is not using the base class is GTK.
-    static PassRefPtr<Scrollbar> createNativeScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size);
-
-    // Called by the ScrollbarClient when the scroll offset changes.
+    // Called by the ScrollableArea when the scroll offset changes.
     void offsetDidChange();
 
     static int pixelsPerLineStep() { return 40; }
     static float minFractionToStepWhenPaging() { return 0.875f; }
     static int maxOverlapBetweenPages();
 
-    void setClient(ScrollbarClient* client) { m_client = client; }
-    ScrollbarClient* client() const { return m_client; }
+    void disconnectFromScrollableArea() { m_scrollableArea = 0; }
+    ScrollableArea* scrollableArea() const { return m_scrollableArea; }
 
     virtual bool isCustomScrollbar() const { return false; }
     ScrollbarOrientation orientation() const { return m_orientation; }
@@ -130,7 +125,7 @@ public:
     virtual IntPoint convertFromContainingView(const IntPoint&) const;
 
 protected:
-    Scrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = 0);
+    Scrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = 0);
 
     void updateThumb();
     virtual void updateThumbPosition();
@@ -145,7 +140,7 @@ protected:
     
     void moveThumb(int pos);
 
-    ScrollbarClient* m_client;
+    ScrollableArea* m_scrollableArea;
     ScrollbarOrientation m_orientation;
     ScrollbarControlSize m_controlSize;
     ScrollbarTheme* m_theme;
index bf00ebb..ec5f308 100644 (file)
@@ -34,7 +34,7 @@
 #include "Page.h"
 #include "PlatformMouseEvent.h"
 #include "Scrollbar.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
 #include "Settings.h"
 
 namespace WebCore {
index 300f418..033d953 100644 (file)
@@ -61,7 +61,7 @@ namespace WebCore {
         virtual bool handleWheelEvent(const PlatformWheelEvent&) = 0;
         virtual bool handleKeyEvent(const PlatformKeyboardEvent&) = 0;
 
-        // ScrollbarClient public methods:
+        // ScrollableArea public methods:
         virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&);
         virtual bool isActive() const;
 
index fe09553..b23e625 100644 (file)
@@ -29,8 +29,8 @@
 
 #include "PlatformBridge.h"
 #include "PlatformMouseEvent.h"
+#include "ScrollableArea.h"
 #include "Scrollbar.h"
-#include "ScrollbarClient.h"
 #include "ScrollbarThemeComposite.h"
 
 // -----------------------------------------------------------------------------
@@ -110,7 +110,7 @@ void ScrollbarThemeChromium::paintTickmarks(GraphicsContext* context, Scrollbar*
 
     // Get the tickmarks for the frameview.
     Vector<IntRect> tickmarks;
-    scrollbar->client()->getTickmarks(tickmarks);
+    scrollbar->scrollableArea()->getTickmarks(tickmarks);
     if (!tickmarks.size())
         return;
 
index a7a063d..e71d1e3 100644 (file)
 using namespace std;
 using namespace WebCore;
 
-PassRefPtr<Scrollbar> Scrollbar::createNativeScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size)
+PassRefPtr<Scrollbar> Scrollbar::createNativeScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize size)
 {
-    return adoptRef(new ScrollbarEfl(client, orientation, size));
+    return adoptRef(new ScrollbarEfl(scrollableArea, orientation, size));
 }
 
-ScrollbarEfl::ScrollbarEfl(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
-    : Scrollbar(client, orientation, controlSize)
+ScrollbarEfl::ScrollbarEfl(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
+    : Scrollbar(scrollableArea, orientation, controlSize)
     , m_lastPos(0)
     , m_lastTotalSize(0)
     , m_lastVisibleSize(0)
@@ -84,7 +84,7 @@ static void scrollbarEflEdjeMessage(void* data, Evas_Object* o, Edje_Message_Typ
 
     m = static_cast<Edje_Message_Float*>(msg);
     v = m->val * (that->totalSize() - that->visibleSize());
-    that->client()->scrollToOffsetWithoutAnimation(that->orientation(), v);
+    that->scrollableArea()->scrollToOffsetWithoutAnimation(that->orientation(), v);
 }
 
 void ScrollbarEfl::setParent(ScrollView* view)
index 35375a6..09dc64f 100644 (file)
@@ -52,7 +52,7 @@ public:
     virtual void paint(GraphicsContext* context, const IntRect& damageRect);
 
 protected:
-    ScrollbarEfl(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
+    ScrollbarEfl(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize);
 
     virtual void updateThumbPositionAndProportion();
     virtual void updateThumbPosition();
index 9eef3dc..d1571a5 100644 (file)
 #include "GraphicsContext.h"
 #include "GtkVersioning.h"
 #include "IntRect.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
 #include <gtk/gtk.h>
 
 using namespace WebCore;
 
-PassRefPtr<MainFrameScrollbarGtk> MainFrameScrollbarGtk::create(ScrollbarClient* client, ScrollbarOrientation orientation, GtkAdjustment* adj)
+PassRefPtr<MainFrameScrollbarGtk> MainFrameScrollbarGtk::create(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, GtkAdjustment* adj)
 {
-    return adoptRef(new MainFrameScrollbarGtk(client, orientation, adj));
+    return adoptRef(new MainFrameScrollbarGtk(scrollableArea, orientation, adj));
 }
 
 // Main frame scrollbars are slaves to a GtkAdjustment. If a main frame
@@ -42,8 +42,8 @@ PassRefPtr<MainFrameScrollbarGtk> MainFrameScrollbarGtk::create(ScrollbarClient*
 // state. These scrollbars are never painted, as the container takes care of
 // that. They exist only to shuttle data from the GtkWidget container into
 // WebCore and vice-versa.
-MainFrameScrollbarGtk::MainFrameScrollbarGtk(ScrollbarClient* client, ScrollbarOrientation orientation, GtkAdjustment* adjustment)
-    : Scrollbar(client, orientation, RegularScrollbar)
+MainFrameScrollbarGtk::MainFrameScrollbarGtk(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, GtkAdjustment* adjustment)
+    : Scrollbar(scrollableArea, orientation, RegularScrollbar)
     , m_adjustment(0)
 {
     attachAdjustment(adjustment);
@@ -109,7 +109,7 @@ void MainFrameScrollbarGtk::updateThumbProportion()
 
 void MainFrameScrollbarGtk::gtkValueChanged(GtkAdjustment*, MainFrameScrollbarGtk* that)
 {
-    that->client()->scrollToOffsetWithoutAnimation(that->orientation(), static_cast<int>(gtk_adjustment_get_value(that->m_adjustment.get())));
+    that->scrollableArea()->scrollToOffsetWithoutAnimation(that->orientation(), static_cast<int>(gtk_adjustment_get_value(that->m_adjustment.get())));
 }
 
 void MainFrameScrollbarGtk::paint(GraphicsContext* context, const IntRect& rect)
index f184425..f104f81 100644 (file)
@@ -30,18 +30,19 @@ namespace WebCore {
 
 class MainFrameScrollbarGtk : public Scrollbar {
 public:
+    static PassRefPtr<MainFrameScrollbarGtk> create(ScrollableArea*, ScrollbarOrientation, GtkAdjustment*);
+
     ~MainFrameScrollbarGtk();
     virtual void paint(GraphicsContext*, const IntRect&);
     void detachAdjustment();
     void attachAdjustment(GtkAdjustment*);
-    static PassRefPtr<MainFrameScrollbarGtk> create(ScrollbarClient*, ScrollbarOrientation, GtkAdjustment*);
 
 protected:
     virtual void updateThumbPosition();
     virtual void updateThumbProportion();
 
 private:
-    MainFrameScrollbarGtk(ScrollbarClient*, ScrollbarOrientation, GtkAdjustment*);
+    MainFrameScrollbarGtk(ScrollableArea*, ScrollbarOrientation, GtkAdjustment*);
     static void gtkValueChanged(GtkAdjustment*, MainFrameScrollbarGtk*);
 
     GRefPtr<GtkAdjustment> m_adjustment;
index 401833c..f05db40 100644 (file)
@@ -41,7 +41,7 @@ namespace WebCore {
 
 class ScrollAnimatorMac : public ScrollAnimator {
 public:
-    ScrollAnimatorMac(ScrollbarClient*);
+    ScrollAnimatorMac(ScrollableArea*);
     virtual ~ScrollAnimatorMac();
 
     virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float step, float multiplier);
index fcca519..59b333b 100644 (file)
 
 #if ENABLE(SMOOTH_SCROLLING)
 
-#include "FloatPoint.h"
 #include "ScrollAnimatorMac.h"
-#include "ScrollbarClient.h"
+
+#include "FloatPoint.h"
+#include "ScrollableArea.h"
+#include <wtf/PassOwnPtr.h>
 
 @interface NSObject (NSScrollAnimationHelperDetails)
 - (id)initWithDelegate:(id)delegate;
@@ -122,13 +124,13 @@ static NSSize abs(NSSize size)
 
 namespace WebCore {
 
-ScrollAnimator* ScrollAnimator::create(ScrollbarClient* client)
+PassOwnPtr<ScrollAnimator> ScrollAnimator::create(ScrollableArea* scrollableArea)
 {
-    return new ScrollAnimatorMac(client);
+    return adoptPtr(new ScrollAnimatorMac(scrollableArea));
 }
 
-ScrollAnimatorMac::ScrollAnimatorMac(ScrollbarClient* client)
-    : ScrollAnimator(client)
+ScrollAnimatorMac::ScrollAnimatorMac(ScrollableArea* scrollableArea)
+    : ScrollAnimator(scrollableArea)
 {
     m_scrollAnimationHelperDelegate.adoptNS([[ScrollAnimationHelperDelegate alloc] initWithScrollAnimator:this]);
     m_scrollAnimationHelper.adoptNS([[NSClassFromString(@"NSScrollAnimationHelper") alloc] initWithDelegate:m_scrollAnimationHelperDelegate.get()]);
@@ -147,7 +149,7 @@ bool ScrollAnimatorMac::scroll(ScrollbarOrientation orientation, ScrollGranulari
         return ScrollAnimator::scroll(orientation, granularity, step, multiplier);
 
     float currentPos = orientation == HorizontalScrollbar ? m_currentPosX : m_currentPosY;
-    float newPos = std::max<float>(std::min<float>(currentPos + (step * multiplier), static_cast<float>(m_client->scrollSize(orientation))), 0);
+    float newPos = std::max<float>(std::min<float>(currentPos + (step * multiplier), static_cast<float>(m_scrollableArea->scrollSize(orientation))), 0);
     if (currentPos == newPos)
         return false;
 
index ee1f5ed..032d9f3 100644 (file)
@@ -420,7 +420,7 @@ bool ScrollbarThemeMac::paint(Scrollbar* scrollbar, GraphicsContext* context, co
     if (!scrollbar->enabled())
         trackInfo.enableState = kThemeTrackDisabled;
     else
-        trackInfo.enableState = scrollbar->client()->isActive() ? kThemeTrackActive : kThemeTrackInactive;
+        trackInfo.enableState = scrollbar->scrollableArea()->isActive() ? kThemeTrackActive : kThemeTrackInactive;
 
     if (hasThumb(scrollbar))
         trackInfo.attributes |= kThemeTrackShowThumb;
index d32e693..dda82e9 100644 (file)
@@ -34,7 +34,7 @@
 #include "GraphicsContext.h"
 #include "IntRect.h"
 #include "PlatformMouseEvent.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
 #include "ScrollbarTheme.h"
 
 #include <QApplication>
@@ -77,17 +77,17 @@ bool Scrollbar::contextMenu(const PlatformMouseEvent& event)
         const QPoint pos = convertFromContainingWindow(event.pos());
         moveThumb(horizontal ? pos.x() : pos.y());
     } else if (actionSelected == actScrollTop)
-        client()->scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByDocument);
+        scrollableArea()->scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByDocument);
     else if (actionSelected == actScrollBottom)
-        client()->scroll(horizontal ? ScrollRight : ScrollDown, ScrollByDocument);
+        scrollableArea()->scroll(horizontal ? ScrollRight : ScrollDown, ScrollByDocument);
     else if (actionSelected == actPageUp)
-        client()->scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByPage);
+        scrollableArea()->scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByPage);
     else if (actionSelected == actPageDown)
-        client()->scroll(horizontal ? ScrollRight : ScrollDown, ScrollByPage);
+        scrollableArea()->scroll(horizontal ? ScrollRight : ScrollDown, ScrollByPage);
     else if (actionSelected == actScrollUp)
-        client()->scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByLine);
+        scrollableArea()->scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByLine);
     else if (actionSelected == actScrollDown)
-        client()->scroll(horizontal ? ScrollRight : ScrollDown, ScrollByLine);
+        scrollableArea()->scroll(horizontal ? ScrollRight : ScrollDown, ScrollByLine);
 #endif // QT_NO_CONTEXTMENU
     return true;
 }
index fe903cd..15871e6 100644 (file)
@@ -532,12 +532,12 @@ bool PopupMenuWin::scrollToRevealSelection()
     int index = focusedIndex();
 
     if (index < m_scrollOffset) {
-        ScrollbarClient::scrollToYOffsetWithoutAnimation(index);
+        ScrollableArea::scrollToYOffsetWithoutAnimation(index);
         return true;
     }
 
     if (index >= m_scrollOffset + visibleItems()) {
-        ScrollbarClient::scrollToYOffsetWithoutAnimation(index - visibleItems() + 1);
+        ScrollableArea::scrollToYOffsetWithoutAnimation(index - visibleItems() + 1);
         return true;
     }
 
@@ -994,7 +994,7 @@ LRESULT PopupMenuWin::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
                     --i;
             }
 
-            ScrollbarClient::scroll(i > 0 ? ScrollUp : ScrollDown, ScrollByLine, abs(i));
+            ScrollableArea::scroll(i > 0 ? ScrollUp : ScrollDown, ScrollByLine, abs(i));
             break;
         }
 
index de7a93d..0d7630c 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
  *
  * This library is free software; you can redistribute it and/or
@@ -23,8 +24,8 @@
 #include "IntRect.h"
 #include "PopupMenu.h"
 #include "PopupMenuClient.h"
+#include "ScrollableArea.h"
 #include "Scrollbar.h"
-#include "ScrollbarClient.h"
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
@@ -38,7 +39,7 @@ namespace WebCore {
 class FrameView;
 class Scrollbar;
 
-class PopupMenuWin : public PopupMenu, private ScrollbarClient {
+class PopupMenuWin : public PopupMenu, private ScrollableArea {
 public:
     PopupMenuWin(PopupMenuClient*);
     ~PopupMenuWin();
@@ -89,7 +90,7 @@ private:
     bool scrollbarCapturingMouse() const { return m_scrollbarCapturingMouse; }
     void setScrollbarCapturingMouse(bool b) { m_scrollbarCapturingMouse = b; }
 
-    // ScrollBarClient
+    // ScrollableArea
     virtual int scrollSize(ScrollbarOrientation orientation) const;
     virtual int scrollPosition(Scrollbar*) const;
     virtual void setScrollOffset(const IntPoint&);
@@ -98,7 +99,7 @@ private:
     virtual bool scrollbarCornerPresent() const { return false; }
     virtual Scrollbar* verticalScrollbar() const { return m_scrollbar.get(); }
 
-    // NOTE: This should only be called by the overriden setScrollOffset from ScrollbarClient.
+    // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
     void scrollTo(int offset);
 
     void calculatePositionAndSize(const IntRect&, FrameView*);
@@ -123,6 +124,6 @@ private:
     bool m_showPopup;
 };
 
-}
+} // namespace WebCore
 
 #endif // PopupMenuWin_h
index 4e979f2..343bbb2 100644 (file)
@@ -32,8 +32,8 @@
 #include "IntRect.h"
 #include "Page.h"
 #include "PlatformMouseEvent.h"
+#include "ScrollableArea.h"
 #include "Scrollbar.h"
-#include "ScrollbarClient.h"
 #include "ScrollbarThemeWin.h"
 #include "Settings.h"
 #include "SoftLinking.h"
@@ -209,7 +209,7 @@ void ScrollbarThemeSafari::paintTrackBackground(GraphicsContext* graphicsContext
         return;
     NSControlSize size = scrollbar->controlSize() == SmallScrollbar ? NSSmallControlSize : NSRegularControlSize;
     ThemeControlState state = 0;
-    if (scrollbar->client()->isActive())
+    if (scrollbar->scrollableArea()->isActive())
         state |= ActiveState;
     if (hasButtons(scrollbar))
         state |= EnabledState;
@@ -222,7 +222,7 @@ void ScrollbarThemeSafari::paintButton(GraphicsContext* graphicsContext, Scrollb
         return;
     NSControlSize size = scrollbar->controlSize() == SmallScrollbar ? NSSmallControlSize : NSRegularControlSize;
     ThemeControlState state = 0;
-    if (scrollbar->client()->isActive())
+    if (scrollbar->scrollableArea()->isActive())
         state |= ActiveState;
     if (hasButtons(scrollbar))
         state |= EnabledState;
@@ -242,7 +242,7 @@ void ScrollbarThemeSafari::paintThumb(GraphicsContext* graphicsContext, Scrollba
         return;
     NSControlSize size = scrollbar->controlSize() == SmallScrollbar ? NSSmallControlSize : NSRegularControlSize;
     ThemeControlState state = 0;
-    if (scrollbar->client()->isActive())
+    if (scrollbar->scrollableArea()->isActive())
         state |= ActiveState;
     if (hasThumb(scrollbar))
         state |= EnabledState;
index 82e4a15..957f958 100644 (file)
@@ -29,8 +29,8 @@
 #include "HostWindow.h"
 #include "NotImplemented.h"
 #include "PlatformMouseEvent.h"
+#include "ScrollableArea.h"
 #include "Scrollbar.h"
-#include "ScrollbarClient.h"
 #include "scrollbar_render.h"
 #include "ScrollbarThemeComposite.h"
 #include "ScrollView.h"
@@ -185,7 +185,7 @@ bool ScrollbarThemeWx::paint(Scrollbar* scrollbar, GraphicsContext* context, con
 {
     wxOrientation orientation = (scrollbar->orientation() == HorizontalScrollbar) ? wxHORIZONTAL : wxVERTICAL;
     int flags = 0;
-    if (scrollbar->client()->isActive())
+    if (scrollbar->scrollableArea()->isActive())
         flags |= wxCONTROL_FOCUSED;
     
     if (!scrollbar->enabled())
index 1492d26..852010c 100644 (file)
 
 #include "HTMLDataGridElement.h"
 #include "RenderBlock.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
 #include "StyleImage.h"
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
 
 namespace WebCore {
 
-class RenderDataGrid : public RenderBlock, private ScrollbarClient {
+class RenderDataGrid : public RenderBlock, private ScrollableArea {
 public:
     RenderDataGrid(Element*);
     ~RenderDataGrid();
@@ -66,7 +66,7 @@ private:
 
     HTMLDataGridElement* gridElement() const { return static_cast<HTMLDataGridElement*>(node()); }
 
-    // ScrollbarClient interface.
+    // ScrollableArea interface.
     virtual int scrollSize(ScrollbarOrientation orientation) const;
     virtual void setScrollOffsetFromAnimation(const IntPoint&);
     virtual void valueChanged(Scrollbar*);
index 900054e..94a1d90 100644 (file)
@@ -1308,7 +1308,7 @@ void RenderLayer::scrollByRecursively(int xDelta, int yDelta)
 
 void RenderLayer::scrollToOffset(int x, int y)
 {
-    ScrollbarClient::scrollToOffsetWithoutAnimation(IntPoint(x, y));
+    ScrollableArea::scrollToOffsetWithoutAnimation(IntPoint(x, y));
 }
 
 void RenderLayer::scrollTo(int x, int y)
@@ -1820,7 +1820,7 @@ void RenderLayer::destroyScrollbar(ScrollbarOrientation orientation)
             static_cast<RenderScrollbar*>(scrollbar.get())->clearOwningRenderer();
 
         scrollbar->removeFromParent();
-        scrollbar->setClient(0);
+        scrollbar->disconnectFromScrollableArea();
         scrollbar = 0;
     }
 }
@@ -2274,7 +2274,7 @@ bool RenderLayer::hitTestOverflowControls(HitTestResult& result, const IntPoint&
 
 bool RenderLayer::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
 {
-    return ScrollbarClient::scroll(direction, granularity, multiplier);
+    return ScrollableArea::scroll(direction, granularity, multiplier);
 }
 
 void RenderLayer::paint(GraphicsContext* p, const IntRect& damageRect, PaintBehavior paintBehavior, RenderObject *paintingRoot)
index cca3a7e..a9a817b 100644 (file)
@@ -47,7 +47,7 @@
 #include "PaintInfo.h"
 #include "RenderBox.h"
 #include "ScrollBehavior.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
 #include <wtf/OwnPtr.h>
 
 namespace WebCore {
@@ -154,7 +154,7 @@ private:
     bool m_fixed : 1;
 };
 
-class RenderLayer : public ScrollbarClient {
+class RenderLayer : public ScrollableArea {
 public:
     friend class RenderReplica;
 
@@ -513,7 +513,7 @@ private:
 
     bool shouldBeNormalFlowOnly() const; 
 
-    // ScrollBarClient interface
+    // ScrollableArea interface
     virtual int scrollSize(ScrollbarOrientation orientation) const;
     virtual void setScrollOffset(const IntPoint&);
     virtual int scrollPosition(Scrollbar*) const;
@@ -525,7 +525,7 @@ private:
     virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, const IntPoint&) const;
     virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoint&) const;
 
-    // NOTE: This should only be called by the overriden setScrollOffset from ScrollbarClient.
+    // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
     void scrollTo(int x, int y);
 
     IntSize scrollbarOffset(const Scrollbar*) const;
index 3df1486..90f13da 100644 (file)
@@ -495,7 +495,7 @@ bool RenderListBox::scrollToRevealElementAtListIndex(int index)
     else
         newOffset = index - numVisibleItems() + 1;
 
-    ScrollbarClient::scrollToYOffsetWithoutAnimation(newOffset);
+    ScrollableArea::scrollToYOffsetWithoutAnimation(newOffset);
 
     return true;
 }
@@ -507,12 +507,12 @@ bool RenderListBox::listIndexIsVisible(int index)
 
 bool RenderListBox::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier, Node**)
 {
-    return ScrollbarClient::scroll(direction, granularity, multiplier);
+    return ScrollableArea::scroll(direction, granularity, multiplier);
 }
 
 bool RenderListBox::logicalScroll(ScrollLogicalDirection direction, ScrollGranularity granularity, float multiplier, Node**)
 {
-    return ScrollbarClient::scroll(logicalToPhysical(direction, style()->isHorizontalWritingMode(), style()->isFlippedBlocksWritingMode()), granularity, multiplier);
+    return ScrollableArea::scroll(logicalToPhysical(direction, style()->isHorizontalWritingMode(), style()->isFlippedBlocksWritingMode()), granularity, multiplier);
 }
 
 void RenderListBox::valueChanged(unsigned listIndex)
@@ -592,7 +592,7 @@ void RenderListBox::setScrollTop(int newTop)
     if (index < 0 || index >= numItems() || index == m_indexOffset)
         return;
     
-    ScrollbarClient::scrollToYOffsetWithoutAnimation(index);
+    ScrollableArea::scrollToYOffsetWithoutAnimation(index);
 }
 
 bool RenderListBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
@@ -714,7 +714,7 @@ void RenderListBox::destroyScrollbar()
         return;
     
     m_vBar->removeFromParent();
-    m_vBar->setClient(0);
+    m_vBar->disconnectFromScrollableArea();
     m_vBar = 0;
 }
 
index f768247..1ba2b94 100644 (file)
 #define RenderListBox_h
 
 #include "RenderBlock.h"
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
 
 namespace WebCore {
 
-class RenderListBox : public RenderBlock, private ScrollbarClient {
+class RenderListBox : public RenderBlock, private ScrollableArea {
 public:
     RenderListBox(Element*);
     virtual ~RenderListBox();
@@ -94,7 +94,7 @@ private:
 
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
 
-    // ScrollbarClient interface.
+    // ScrollableArea interface.
     virtual int scrollSize(ScrollbarOrientation orientation) const;
     virtual int scrollPosition(Scrollbar*) const;
     virtual void setScrollOffset(const IntPoint&);
@@ -107,7 +107,7 @@ private:
     virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoint&) const;
     virtual Scrollbar* verticalScrollbar() const { return m_vBar.get(); }
 
-    // NOTE: This should only be called by the overriden setScrollOffset from ScrollbarClient.
+    // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
     void scrollTo(int newOffset);
 
     void setHasVerticalScrollbar(bool hasScrollbar);
index 8b98370..e55b5ca 100644 (file)
@@ -456,14 +456,14 @@ HostWindow* RenderMenuList::hostWindow() const
     return document()->view()->hostWindow();
 }
 
-PassRefPtr<Scrollbar> RenderMenuList::createScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
+PassRefPtr<Scrollbar> RenderMenuList::createScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
 {
     RefPtr<Scrollbar> widget;
     bool hasCustomScrollbarStyle = style()->hasPseudoStyle(SCROLLBAR);
     if (hasCustomScrollbarStyle)
-        widget = RenderScrollbar::createCustomScrollbar(client, orientation, this);
+        widget = RenderScrollbar::createCustomScrollbar(scrollableArea, orientation, this);
     else
-        widget = Scrollbar::createNativeScrollbar(client, orientation, controlSize);
+        widget = Scrollbar::createNativeScrollbar(scrollableArea, orientation, controlSize);
     return widget.release();
 }
 
index 2c99b1e..b84b799 100644 (file)
@@ -107,7 +107,7 @@ private:
     virtual void selectionCleared() {}
     virtual FontSelector* fontSelector() const;
     virtual HostWindow* hostWindow() const;
-    virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
+    virtual PassRefPtr<Scrollbar> createScrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize);
 
 #if ENABLE(NO_LISTBOX_RENDERING)
     virtual void listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow = true);
index 44a0126..4091d51 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<Scrollbar> RenderScrollbar::createCustomScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, RenderBox* renderer, Frame* owningFrame)
+PassRefPtr<Scrollbar> RenderScrollbar::createCustomScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, RenderBox* renderer, Frame* owningFrame)
 {
-    return adoptRef(new RenderScrollbar(client, orientation, renderer, owningFrame));
+    return adoptRef(new RenderScrollbar(scrollableArea, orientation, renderer, owningFrame));
 }
 
-RenderScrollbar::RenderScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, RenderBox* renderer, Frame* owningFrame)
-    : Scrollbar(client, orientation, RegularScrollbar, RenderScrollbarTheme::renderScrollbarTheme())
+RenderScrollbar::RenderScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, RenderBox* renderer, Frame* owningFrame)
+    : Scrollbar(scrollableArea, orientation, RegularScrollbar, RenderScrollbarTheme::renderScrollbarTheme())
     , m_owner(renderer)
     , m_owningFrame(owningFrame)
 {
index de70624..8f4de4f 100644 (file)
@@ -39,11 +39,11 @@ class RenderStyle;
 
 class RenderScrollbar : public Scrollbar {
 protected:
-    RenderScrollbar(ScrollbarClient*, ScrollbarOrientation, RenderBox*, Frame*);
+    RenderScrollbar(ScrollableArea*, ScrollbarOrientation, RenderBox*, Frame*);
 
 public:
     friend class Scrollbar;
-    static PassRefPtr<Scrollbar> createCustomScrollbar(ScrollbarClient*, ScrollbarOrientation, RenderBox*, Frame* owningFrame = 0);
+    static PassRefPtr<Scrollbar> createCustomScrollbar(ScrollableArea*, ScrollbarOrientation, RenderBox*, Frame* owningFrame = 0);
     virtual ~RenderScrollbar();
 
     static ScrollbarPart partForStyleResolve();
index c850321..306e8ba 100644 (file)
@@ -1079,14 +1079,14 @@ bool RenderTextControlSingleLine::logicalScroll(ScrollLogicalDirection direction
     return RenderBlock::logicalScroll(direction, granularity, multiplier, stopNode);
 }
 
-PassRefPtr<Scrollbar> RenderTextControlSingleLine::createScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
+PassRefPtr<Scrollbar> RenderTextControlSingleLine::createScrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
 {
     RefPtr<Scrollbar> widget;
     bool hasCustomScrollbarStyle = style()->hasPseudoStyle(SCROLLBAR);
     if (hasCustomScrollbarStyle)
-        widget = RenderScrollbar::createCustomScrollbar(client, orientation, this);
+        widget = RenderScrollbar::createCustomScrollbar(scrollableArea, orientation, this);
     else
-        widget = Scrollbar::createNativeScrollbar(client, orientation, controlSize);
+        widget = Scrollbar::createNativeScrollbar(scrollableArea, orientation, controlSize);
     return widget.release();
 }
 
index 16ce1e4..6b99f59 100644 (file)
@@ -140,7 +140,7 @@ private:
     virtual void setTextFromItem(unsigned listIndex);
     virtual FontSelector* fontSelector() const;
     virtual HostWindow* hostWindow() const;
-    virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize);
+    virtual PassRefPtr<Scrollbar> createScrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize);
 
     InputElement* inputElement() const;
 
index c50aa6f..1b0de4a 100644 (file)
@@ -1,3 +1,24 @@
+2011-01-21  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        Part 2 of "Cleanup Scrollbar/ScrollbarClient relationship"
+        https://bugs.webkit.org/show_bug.cgi?id=52779
+
+        Rename ScrollbarClient -> ScrollableArea.
+
+        * src/AutoFillPopupMenuClient.cpp:
+        (WebKit::AutoFillPopupMenuClient::createScrollbar):
+        * src/AutoFillPopupMenuClient.h:
+        * src/WebScrollbarImpl.cpp:
+        (WebKit::WebScrollbarImpl::WebScrollbarImpl):
+        (WebKit::WebScrollbarImpl::scroll):
+        (WebKit::WebScrollbarImpl::onMouseWheel):
+        (WebKit::WebScrollbarImpl::onKeyDown):
+        * src/WebScrollbarImpl.h:
+        * tests/PopupMenuTest.cpp:
+        (WebKit::TestPopupMenuClient::createScrollbar):
+
 2011-01-21  Sailesh Agrawal  <sail@chromium.org>
 
         Reviewed by Ryosuke Niwa.
index 4f57994..2ce31a9 100644 (file)
@@ -254,11 +254,11 @@ HostWindow* AutoFillPopupMenuClient::hostWindow() const
 }
 
 PassRefPtr<Scrollbar> AutoFillPopupMenuClient::createScrollbar(
-    ScrollbarClient* client,
+    ScrollableArea* scrollableArea,
     ScrollbarOrientation orientation,
     ScrollbarControlSize size)
 {
-    return Scrollbar::createNativeScrollbar(client, orientation, size);
+    return Scrollbar::createNativeScrollbar(scrollableArea, orientation, size);
 }
 
 void AutoFillPopupMenuClient::initialize(
index 0129a81..0071121 100644 (file)
@@ -97,7 +97,7 @@ public:
     virtual WebCore::FontSelector* fontSelector() const;
     virtual WebCore::HostWindow* hostWindow() const;
     virtual PassRefPtr<WebCore::Scrollbar> createScrollbar(
-        WebCore::ScrollbarClient* client,
+        WebCore::ScrollableArea* client,
         WebCore::ScrollbarOrientation orientation,
         WebCore::ScrollbarControlSize size);
 
index 527634a..004ae1c 100644 (file)
@@ -65,7 +65,7 @@ WebScrollbarImpl::WebScrollbarImpl(WebScrollbarClient* client, Orientation orien
     , m_scrollOffset(0)
 {
     m_scrollbar = Scrollbar::createNativeScrollbar(
-        static_cast<ScrollbarClient*>(this),
+        static_cast<ScrollableArea*>(this),
         static_cast<ScrollbarOrientation>(orientation),
         RegularScrollbar);
 }
@@ -114,7 +114,7 @@ void WebScrollbarImpl::scroll(ScrollDirection direction, ScrollGranularity granu
     else
         dir = horizontal ? ScrollLeft : ScrollUp;
 
-    WebCore::ScrollbarClient::scroll(dir, static_cast<WebCore::ScrollGranularity>(granularity), multiplier);
+    WebCore::ScrollableArea::scroll(dir, static_cast<WebCore::ScrollGranularity>(granularity), multiplier);
 }
 
 void WebScrollbarImpl::paint(WebCanvas* canvas, const WebRect& rect)
@@ -220,7 +220,7 @@ bool WebScrollbarImpl::onMouseWheel(const WebInputEvent& event)
             if (negative)
                 delta *= -1;
         }
-        WebCore::ScrollbarClient::scroll((m_scrollbar->orientation() == HorizontalScrollbar) ? WebCore::ScrollLeft : WebCore::ScrollUp, WebCore::ScrollByPixel, delta);
+        WebCore::ScrollableArea::scroll((m_scrollbar->orientation() == HorizontalScrollbar) ? WebCore::ScrollLeft : WebCore::ScrollUp, WebCore::ScrollByPixel, delta);
         return true;
     }
 
@@ -259,7 +259,7 @@ bool WebScrollbarImpl::onKeyDown(const WebInputEvent& event)
     WebCore::ScrollGranularity scrollGranularity;
     if (WebViewImpl::mapKeyCodeForScroll(keyCode, &scrollDirection, &scrollGranularity)) {
         // Will return false if scroll direction wasn't compatible with this scrollbar.
-        return WebCore::ScrollbarClient::scroll(scrollDirection, scrollGranularity);
+        return WebCore::ScrollableArea::scroll(scrollDirection, scrollGranularity);
     }
     return false;
 }
index 71b6dca..4dcfd5d 100644 (file)
@@ -31,7 +31,7 @@
 #ifndef WebScrollbarImpl_h
 #define WebScrollbarImpl_h
 
-#include "ScrollbarClient.h"
+#include "ScrollableArea.h"
 #include "WebScrollbar.h"
 
 #include <wtf/RefPtr.h>
@@ -43,7 +43,7 @@ class Scrollbar;
 namespace WebKit {
 
 class WebScrollbarImpl : public WebScrollbar,
-                         public WebCore::ScrollbarClient {
+                         public WebCore::ScrollableArea {
 public:
     WebScrollbarImpl(WebScrollbarClient*, Orientation orientation);
     ~WebScrollbarImpl();
@@ -57,7 +57,7 @@ public:
     virtual void paint(WebCanvas*, const WebRect&);
     virtual bool handleInputEvent(const WebInputEvent&);
 
-    // WebCore::ScrollbarClient methods
+    // WebCore::ScrollableArea methods
     virtual int scrollSize(WebCore::ScrollbarOrientation) const;
     virtual int scrollPosition(WebCore::Scrollbar*) const;
     virtual void setScrollOffset(const WebCore::IntPoint&);
index dab5ff9..4c9a149 100644 (file)
@@ -96,7 +96,7 @@ public:
     virtual FontSelector* fontSelector() const { return 0; }
     virtual HostWindow* hostWindow() const { return 0; }
     
-    virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize) { return 0; }
+    virtual PassRefPtr<Scrollbar> createScrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize) { return 0; }
 
 private:
     unsigned m_selectIndex;
index e5019d2..0d502b3 100644 (file)
@@ -1071,7 +1071,7 @@ void QWebFrame::setScrollBarValue(Qt::Orientation orientation, int value)
             value = 0;
         else if (value > scrollBarMaximum(orientation))
             value = scrollBarMaximum(orientation);
-        sb->client()->scrollToOffsetWithoutAnimation(orientation == Qt::Horizontal ? HorizontalScrollbar : VerticalScrollbar, value);
+        sb->scrollableArea()->scrollToOffsetWithoutAnimation(orientation == Qt::Horizontal ? HorizontalScrollbar : VerticalScrollbar, value);
     }
 }
 
index aba8a47..aec5b45 100644 (file)
@@ -1,3 +1,15 @@
+2011-01-21  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        Part 2 of "Cleanup Scrollbar/ScrollbarClient relationship"
+        https://bugs.webkit.org/show_bug.cgi?id=52779
+
+        Rename ScrollbarClient -> ScrollableArea.
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::setScrollBarValue):
+
 2011-01-20  Sam Weinig  <sam@webkit.org>
 
         Fix build.
index b1981da..7776c1e 100644 (file)
@@ -1,3 +1,16 @@
+2011-01-21  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        Part 2 of "Cleanup Scrollbar/ScrollbarClient relationship"
+        https://bugs.webkit.org/show_bug.cgi?id=52779
+
+        Rename ScrollbarClient -> ScrollableArea.
+
+        * WebScrollBar.cpp:
+        (WebScrollBar::scroll):
+        * WebScrollBar.h:
+
 2011-01-20  Adam Roben  <aroben@apple.com>
 
         Update for CACFLayerTreeHost changes
index 1f8cb84..45bc8f3 100644 (file)
@@ -248,11 +248,12 @@ HRESULT STDMETHODCALLTYPE WebScrollBar::scroll(
 {
     ScrollDirection webCoreScrollDirection = (ScrollDirection) direction;
     ScrollGranularity webCoreGranularity = (ScrollGranularity) granularity;
-    ScrollbarClient::scroll(webCoreScrollDirection, webCoreGranularity, multiplier);
+    ScrollableArea::scroll(webCoreScrollDirection, webCoreGranularity, multiplier);
     return S_OK;
 }
 
-// ScrollbarClient -------------------------------------------------------
+// ScrollableArea -------------------------------------------------------
+
 int WebScrollBar::scrollSize(ScrollbarOrientation orientation) const
 {
     return (orientation == m_scrollBar->orientation()) ? (m_scrollBar->totalSize() - m_scrollBar->visibleSize()) : 0; 
index d7d923b..cad926e 100644 (file)
 #pragma warning(push, 0)
 #include <WebCore/COMPtr.h>
 #include <WebCore/Scrollbar.h>
-#include <WebCore/ScrollbarClient.h>
+#include <WebCore/ScrollableArea.h>
 #pragma warning(pop)
 
 namespace WebCore {
 class Scrollbar;
 }
 
-using namespace WebCore;
-
-class WebScrollBar : public IWebScrollBarPrivate, ScrollbarClient
-{
+class WebScrollBar : public IWebScrollBarPrivate, WebCore::ScrollableArea {
 public:
     static WebScrollBar* createInstance();
 protected:
@@ -115,7 +112,7 @@ public:
         /* [in] */ float multiplier);
 
 protected:
-    // ScrollbarClient
+    // ScrollableArea
     virtual int scrollSize(ScrollbarOrientation orientation) const;
     virtual int scrollPosition(Scrollbar*) const;
     virtual void setScrollOffset(const IntPoint&);
index 6bfc039..2edcaaa 100644 (file)
@@ -1,3 +1,17 @@
+2011-01-21  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        Part 2 of "Cleanup Scrollbar/ScrollbarClient relationship"
+        https://bugs.webkit.org/show_bug.cgi?id=52779
+
+        Rename ScrollbarClient -> ScrollableArea.
+
+        * UIProcess/win/WebPopupMenuProxyWin.cpp:
+        (WebKit::WebPopupMenuProxyWin::onMouseWheel):
+        (WebKit::WebPopupMenuProxyWin::scrollToRevealSelection):
+        * UIProcess/win/WebPopupMenuProxyWin.h:
+
 2011-01-21  Adam Roben  <aroben@apple.com>
 
         Update for WKCACFLayerRenderer -> CACFLayerView rename
index ae97ab8..40e3556 100644 (file)
@@ -432,8 +432,6 @@ void WebPopupMenuProxyWin::invalidateItem(int index)
     ::InvalidateRect(m_popup, &r, TRUE);
 }
 
-// ScrollbarClient
-
 int WebPopupMenuProxyWin::scrollSize(ScrollbarOrientation orientation) const
 {
     return ((orientation == VerticalScrollbar) && m_scrollbar) ? (m_scrollbar->totalSize() - m_scrollbar->visibleSize()) : 0;
@@ -723,7 +721,7 @@ LRESULT WebPopupMenuProxyWin::onMouseWheel(HWND hWnd, UINT message, WPARAM wPara
             --i;
     }
 
-    ScrollbarClient::scroll(i > 0 ? ScrollUp : ScrollDown, ScrollByLine, abs(i));
+    ScrollableArea::scroll(i > 0 ? ScrollUp : ScrollDown, ScrollByLine, abs(i));
     return 0;
 }
 
@@ -925,12 +923,12 @@ bool WebPopupMenuProxyWin::scrollToRevealSelection()
     int index = focusedIndex();
 
     if (index < m_scrollOffset) {
-        ScrollbarClient::scrollToYOffsetWithoutAnimation(index);
+        ScrollableArea::scrollToYOffsetWithoutAnimation(index);
         return true;
     }
 
     if (index >= m_scrollOffset + visibleItems()) {
-        ScrollbarClient::scrollToYOffsetWithoutAnimation(index - visibleItems() + 1);
+        ScrollableArea::scrollToYOffsetWithoutAnimation(index - visibleItems() + 1);
         return true;
     }
 
index 0ed69e2..d1dc466 100644 (file)
@@ -30,7 +30,7 @@
 #include "WebPopupItem.h"
 #include "WebPopupMenuProxy.h"
 #include <WebCore/Scrollbar.h>
-#include <WebCore/ScrollbarClient.h>
+#include <WebCore/ScrollableArea.h>
 
 typedef struct HWND__* HWND;
 typedef struct HDC__* HDC;
@@ -40,7 +40,7 @@ namespace WebKit {
 
 class WebView;
 
-class WebPopupMenuProxyWin : public WebPopupMenuProxy, private WebCore::ScrollbarClient  {
+class WebPopupMenuProxyWin : public WebPopupMenuProxy, private WebCore::ScrollableArea  {
 public:
     static PassRefPtr<WebPopupMenuProxyWin> create(WebView* webView, WebPopupMenuProxy::Client* client)
     {
@@ -58,8 +58,8 @@ private:
 
     WebCore::Scrollbar* scrollbar() const { return m_scrollbar.get(); }
 
-    // ScrollBarClient
-    virtual int scrollSize(WebCore::ScrollbarOrientation orientation) const;
+    // ScrollableArea
+    virtual int scrollSize(WebCore::ScrollbarOrientation) const;
     virtual int scrollPosition(WebCore::Scrollbar*) const;
     virtual void setScrollOffset(const WebCore::IntPoint&);
     virtual void invalidateScrollbarRect(WebCore::Scrollbar*, const WebCore::IntRect&);
@@ -67,7 +67,7 @@ private:
     virtual bool scrollbarCornerPresent() const { return false; }
     virtual WebCore::Scrollbar* verticalScrollbar() const { return m_scrollbar.get(); }
 
-    // NOTE: This should only be called by the overriden setScrollOffset from ScrollbarClient.
+    // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
     void scrollTo(int offset);
 
     static bool registerWindowClass();