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

Side by Side 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, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 14 matching lines...) Expand all
25 25
26 #ifndef ScrollbarThemeMac_h 26 #ifndef ScrollbarThemeMac_h
27 #define ScrollbarThemeMac_h 27 #define ScrollbarThemeMac_h
28 28
29 #include "core/platform/ScrollbarThemeComposite.h" 29 #include "core/platform/ScrollbarThemeComposite.h"
30 30
31 typedef id ScrollbarPainter; 31 typedef id ScrollbarPainter;
32 32
33 namespace WebCore { 33 namespace WebCore {
34 34
35 class ScrollbarThemeMac : public ScrollbarThemeComposite { 35 class ScrollbarThemeMacCommon : public ScrollbarThemeComposite {
36 public: 36 public:
37 ScrollbarThemeMac(); 37 ScrollbarThemeMacCommon();
38 virtual ~ScrollbarThemeMac(); 38 virtual ~ScrollbarThemeMacCommon();
39 39
40 virtual void registerScrollbar(ScrollbarThemeClient*);
41 virtual void unregisterScrollbar(ScrollbarThemeClient*);
40 void preferencesChanged(); 42 void preferencesChanged();
41 43
42 virtual void updateEnabledState(ScrollbarThemeClient*);
43
44 virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
45
46 virtual bool supportsControlTints() const { return true; } 44 virtual bool supportsControlTints() const { return true; }
47 virtual bool usesOverlayScrollbars() const;
48 virtual void updateScrollbarOverlayStyle(ScrollbarThemeClient*);
49 45
50 virtual double initialAutoscrollTimerDelay(); 46 virtual double initialAutoscrollTimerDelay();
51 virtual double autoscrollTimerDelay(); 47 virtual double autoscrollTimerDelay();
52 48
49 virtual void paintOverhangAreas(ScrollView*, GraphicsContext*, const IntRect & horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& di rtyRect);
50 virtual void paintTickmarks(GraphicsContext*, ScrollbarThemeClient*, const I ntRect&) OVERRIDE;
51
52 protected:
53 virtual int maxOverlapBetweenPages() { return 40; }
54
55 virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseE vent&);
56 virtual bool shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const P latformMouseEvent&);
57 int scrollbarPartToHIPressedState(ScrollbarPart);
58
59 virtual void updateButtonPlacement() { }
60
61 void paintGivenTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntR ect&, const Vector<IntRect>&);
62
63 RefPtr<Pattern> m_overhangPattern;
64 };
65
66 class ScrollbarThemeMacOverlayAPI : public ScrollbarThemeMacCommon {
67 public:
68 virtual void updateEnabledState(ScrollbarThemeClient*);
69 virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
70 virtual bool usesOverlayScrollbars() const;
71 virtual void updateScrollbarOverlayStyle(ScrollbarThemeClient*);
53 virtual ScrollbarButtonsPlacement buttonsPlacement() const; 72 virtual ScrollbarButtonsPlacement buttonsPlacement() const;
54 73
55 virtual void registerScrollbar(ScrollbarThemeClient*); 74 virtual void registerScrollbar(ScrollbarThemeClient*);
56 virtual void unregisterScrollbar(ScrollbarThemeClient*); 75 virtual void unregisterScrollbar(ScrollbarThemeClient*);
57 76
58 void setNewPainterForScrollbar(ScrollbarThemeClient*, ScrollbarPainter); 77 void setNewPainterForScrollbar(ScrollbarThemeClient*, ScrollbarPainter);
59 ScrollbarPainter painterForScrollbar(ScrollbarThemeClient*); 78 ScrollbarPainter painterForScrollbar(ScrollbarThemeClient*);
60 79
61 virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& d amageRect);
62 virtual void paintOverhangAreas(ScrollView*, GraphicsContext*, const IntRect & horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& di rtyRect);
63 virtual void paintTickmarks(GraphicsContext*, ScrollbarThemeClient*, const I ntRect&) OVERRIDE;
64 virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, c onst IntRect&); 80 virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, c onst IntRect&);
65 virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRe ct&); 81 virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRe ct&);
66 82
67 protected: 83 protected:
84 virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false);
85 virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool pa inting = false);
86 virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
87
88 virtual bool hasButtons(ScrollbarThemeClient*) { return false; }
89 virtual bool hasThumb(ScrollbarThemeClient*);
90
91 virtual int minimumThumbLength(ScrollbarThemeClient*);
92 };
93
94 class ScrollbarThemeMacNonOverlayAPI : public ScrollbarThemeMacCommon {
95 public:
96 virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
97 virtual bool usesOverlayScrollbars() const { return false; }
98 virtual ScrollbarButtonsPlacement buttonsPlacement() const;
99
100 virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& d amageRect);
101
102 protected:
103 virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false);
104 virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool pa inting = false);
105 virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
106
107 virtual void updateButtonPlacement();
68 108
69 virtual bool hasButtons(ScrollbarThemeClient*); 109 virtual bool hasButtons(ScrollbarThemeClient*);
70 virtual bool hasThumb(ScrollbarThemeClient*); 110 virtual bool hasThumb(ScrollbarThemeClient*);
71 111
72 virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool pa inting = false);
73 virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
74 virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false);
75
76 virtual int maxOverlapBetweenPages() { return 40; }
77
78 virtual int minimumThumbLength(ScrollbarThemeClient*); 112 virtual int minimumThumbLength(ScrollbarThemeClient*);
79
80 virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseE vent&);
81 virtual bool shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const P latformMouseEvent&);
82 int scrollbarPartToHIPressedState(ScrollbarPart);
83
84 void paintGivenTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntR ect&, const Vector<IntRect>&);
85
86 RefPtr<Pattern> m_overhangPattern;
87 }; 113 };
88 114
89 } 115 }
90 116
91 #endif 117 #endif
OLDNEW
« 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