OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google 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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 11 matching lines...) Expand all Loading... |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #include "platform/scroll/ScrollbarThemeOverlay.h" | 26 #include "platform/scroll/ScrollbarThemeOverlay.h" |
27 | 27 |
28 #include "platform/PlatformMouseEvent.h" | 28 #include "platform/PlatformMouseEvent.h" |
29 #include "platform/graphics/GraphicsContext.h" | 29 #include "platform/graphics/GraphicsContext.h" |
30 #include "platform/graphics/paint/DrawingRecorder.h" | 30 #include "platform/graphics/paint/DrawingRecorder.h" |
31 #include "platform/scroll/Scrollbar.h" | 31 #include "platform/scroll/Scrollbar.h" |
| 32 #include "platform/scroll/ScrollbarThemeAura.h" |
32 #include "platform/transforms/TransformationMatrix.h" | 33 #include "platform/transforms/TransformationMatrix.h" |
33 #include "public/platform/Platform.h" | 34 #include "public/platform/Platform.h" |
34 #include "public/platform/WebRect.h" | 35 #include "public/platform/WebRect.h" |
35 #include "public/platform/WebThemeEngine.h" | 36 #include "public/platform/WebThemeEngine.h" |
36 #include "wtf/MathExtras.h" | 37 #include "wtf/MathExtras.h" |
37 | 38 |
38 #include <algorithm> | 39 #include <algorithm> |
39 | 40 |
40 namespace blink { | 41 namespace blink { |
41 | 42 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 IntRect ScrollbarThemeOverlay::trackRect(const ScrollbarThemeClient& scrollbar, | 128 IntRect ScrollbarThemeOverlay::trackRect(const ScrollbarThemeClient& scrollbar, |
128 bool) { | 129 bool) { |
129 IntRect rect = scrollbar.frameRect(); | 130 IntRect rect = scrollbar.frameRect(); |
130 if (scrollbar.orientation() == HorizontalScrollbar) | 131 if (scrollbar.orientation() == HorizontalScrollbar) |
131 rect.inflateX(-m_scrollbarMargin); | 132 rect.inflateX(-m_scrollbarMargin); |
132 else | 133 else |
133 rect.inflateY(-m_scrollbarMargin); | 134 rect.inflateY(-m_scrollbarMargin); |
134 return rect; | 135 return rect; |
135 } | 136 } |
136 | 137 |
| 138 void ScrollbarThemeOverlay::paintTickmarks(GraphicsContext& context, |
| 139 const Scrollbar& scrollbar, |
| 140 const IntRect& rect) { |
| 141 ScrollbarThemeAura::paintAuraTickmarks(context, scrollbar, rect); |
| 142 } |
| 143 |
137 int ScrollbarThemeOverlay::thumbThickness(const ScrollbarThemeClient&) { | 144 int ScrollbarThemeOverlay::thumbThickness(const ScrollbarThemeClient&) { |
138 return m_thumbThickness; | 145 return m_thumbThickness; |
139 } | 146 } |
140 | 147 |
141 void ScrollbarThemeOverlay::paintThumb(GraphicsContext& context, | 148 void ScrollbarThemeOverlay::paintThumb(GraphicsContext& context, |
142 const Scrollbar& scrollbar, | 149 const Scrollbar& scrollbar, |
143 const IntRect& rect) { | 150 const IntRect& rect) { |
144 if (DrawingRecorder::useCachedDrawingIfPossible(context, scrollbar, | 151 if (DrawingRecorder::useCachedDrawingIfPossible(context, scrollbar, |
145 DisplayItem::kScrollbarThumb)) | 152 DisplayItem::kScrollbarThumb)) |
146 return; | 153 return; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 Platform::current()->themeEngine()->getOverlayScrollbarStyle(&style); | 214 Platform::current()->themeEngine()->getOverlayScrollbarStyle(&style); |
208 } | 215 } |
209 theme = new ScrollbarThemeOverlay( | 216 theme = new ScrollbarThemeOverlay( |
210 style.thumbThickness, style.scrollbarMargin, | 217 style.thumbThickness, style.scrollbarMargin, |
211 ScrollbarThemeOverlay::DisallowHitTest, Color(style.color)); | 218 ScrollbarThemeOverlay::DisallowHitTest, Color(style.color)); |
212 } | 219 } |
213 return *theme; | 220 return *theme; |
214 } | 221 } |
215 | 222 |
216 } // namespace blink | 223 } // namespace blink |
OLD | NEW |