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

Unified Diff: Source/core/platform/mac/ScrollbarThemeMac.h

Issue 21296003: Split ScrollbarThemeMac into Overlay and NonOverlay subclasses (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@composited_scrollbar_after_refactor
Patch Set: Rebase Created 7 years, 5 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/mac/ScrollAnimatorMac.mm ('k') | Source/core/platform/mac/ScrollbarThemeMac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/mac/ScrollbarThemeMac.h
diff --git a/Source/core/platform/mac/ScrollbarThemeMac.h b/Source/core/platform/mac/ScrollbarThemeMac.h
index 409d17a2e3f1a9fd4cee85aa0a3868662b64c438..0cfdcfed852a07514f765f113e5a7e96e5981fd1 100644
--- a/Source/core/platform/mac/ScrollbarThemeMac.h
+++ b/Source/core/platform/mac/ScrollbarThemeMac.h
@@ -32,24 +32,43 @@ typedef id ScrollbarPainter;
namespace WebCore {
-class ScrollbarThemeMac : public ScrollbarThemeComposite {
+class ScrollbarThemeMacCommon : public ScrollbarThemeComposite {
public:
- ScrollbarThemeMac();
- virtual ~ScrollbarThemeMac();
+ ScrollbarThemeMacCommon();
+ virtual ~ScrollbarThemeMacCommon();
+ virtual void registerScrollbar(ScrollbarThemeClient*);
+ virtual void unregisterScrollbar(ScrollbarThemeClient*);
void preferencesChanged();
- virtual void updateEnabledState(ScrollbarThemeClient*);
-
- virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
-
virtual bool supportsControlTints() const { return true; }
- virtual bool usesOverlayScrollbars() const;
- virtual void updateScrollbarOverlayStyle(ScrollbarThemeClient*);
virtual double initialAutoscrollTimerDelay();
virtual double autoscrollTimerDelay();
+ virtual void paintOverhangAreas(ScrollView*, GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect);
+ virtual void paintTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
+
+protected:
+ virtual int maxOverlapBetweenPages() { return 40; }
+
+ virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&);
+ virtual bool shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const PlatformMouseEvent&);
+ int scrollbarPartToHIPressedState(ScrollbarPart);
+
+ virtual void updateButtonPlacement() { }
+
+ void paintGivenTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, const Vector<IntRect>&);
+
+ RefPtr<Pattern> m_overhangPattern;
+};
+
+class ScrollbarThemeMacOverlayAPI : public ScrollbarThemeMacCommon {
+public:
+ virtual void updateEnabledState(ScrollbarThemeClient*);
+ virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
+ virtual bool usesOverlayScrollbars() const;
+ virtual void updateScrollbarOverlayStyle(ScrollbarThemeClient*);
virtual ScrollbarButtonsPlacement buttonsPlacement() const;
virtual void registerScrollbar(ScrollbarThemeClient*);
@@ -58,32 +77,39 @@ public:
void setNewPainterForScrollbar(ScrollbarThemeClient*, ScrollbarPainter);
ScrollbarPainter painterForScrollbar(ScrollbarThemeClient*);
- virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& damageRect);
- virtual void paintOverhangAreas(ScrollView*, GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect);
- virtual void paintTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&);
virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&);
protected:
-
- virtual bool hasButtons(ScrollbarThemeClient*);
- virtual bool hasThumb(ScrollbarThemeClient*);
-
+ virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false);
virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
- virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false);
- virtual int maxOverlapBetweenPages() { return 40; }
+ virtual bool hasButtons(ScrollbarThemeClient*) { return false; }
+ virtual bool hasThumb(ScrollbarThemeClient*);
virtual int minimumThumbLength(ScrollbarThemeClient*);
+};
- virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&);
- virtual bool shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const PlatformMouseEvent&);
- int scrollbarPartToHIPressedState(ScrollbarPart);
+class ScrollbarThemeMacNonOverlayAPI : public ScrollbarThemeMacCommon {
+public:
+ virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
+ virtual bool usesOverlayScrollbars() const { return false; }
+ virtual ScrollbarButtonsPlacement buttonsPlacement() const;
- void paintGivenTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, const Vector<IntRect>&);
+ virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& damageRect);
- RefPtr<Pattern> m_overhangPattern;
+protected:
+ virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false);
+ virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
+ virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
+
+ virtual void updateButtonPlacement();
+
+ virtual bool hasButtons(ScrollbarThemeClient*);
+ virtual bool hasThumb(ScrollbarThemeClient*);
+
+ virtual int minimumThumbLength(ScrollbarThemeClient*);
};
}
« no previous file with comments | « Source/core/platform/mac/ScrollAnimatorMac.mm ('k') | Source/core/platform/mac/ScrollbarThemeMac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698