OLD | NEW |
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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 virtual IntRect constrainTrackRectToTrackPieces(const ScrollbarThemeClient&, | 178 virtual IntRect constrainTrackRectToTrackPieces(const ScrollbarThemeClient&, |
179 const IntRect& rect) { | 179 const IntRect& rect) { |
180 return rect; | 180 return rect; |
181 } | 181 } |
182 | 182 |
183 virtual void registerScrollbar(ScrollbarThemeClient&) {} | 183 virtual void registerScrollbar(ScrollbarThemeClient&) {} |
184 virtual void unregisterScrollbar(ScrollbarThemeClient&) {} | 184 virtual void unregisterScrollbar(ScrollbarThemeClient&) {} |
185 | 185 |
186 virtual bool isMockTheme() const { return false; } | 186 virtual bool isMockTheme() const { return false; } |
187 | 187 |
| 188 virtual bool usesNinePatchThumbResource() const { return false; } |
| 189 |
| 190 // For a nine-patch scrollbar, this defines the painting canvas size which the |
| 191 // painting code will use to paint the scrollbar into. The actual scrollbar |
| 192 // dimensions will be ignored for purposes of painting since the resource can |
| 193 // be then resized without a repaint. |
| 194 virtual IntSize ninePatchThumbCanvasSize(const ScrollbarThemeClient&) const { |
| 195 NOTREACHED(); |
| 196 return IntSize(); |
| 197 } |
| 198 |
| 199 // For a nine-patch resource, the aperture defines the center patch that will |
| 200 // be stretched out. |
| 201 virtual IntRect ninePatchThumbAperture(const ScrollbarThemeClient&) const { |
| 202 NOTREACHED(); |
| 203 return IntRect(); |
| 204 } |
| 205 |
188 static ScrollbarTheme& theme(); | 206 static ScrollbarTheme& theme(); |
189 | 207 |
190 static void setMockScrollbarsEnabled(bool flag); | 208 static void setMockScrollbarsEnabled(bool flag); |
191 static bool mockScrollbarsEnabled(); | 209 static bool mockScrollbarsEnabled(); |
192 | 210 |
193 protected: | 211 protected: |
194 virtual int tickmarkBorderWidth() { return 0; } | 212 virtual int tickmarkBorderWidth() { return 0; } |
195 static DisplayItem::Type buttonPartToDisplayItemType(ScrollbarPart); | 213 static DisplayItem::Type buttonPartToDisplayItemType(ScrollbarPart); |
196 static DisplayItem::Type trackPiecePartToDisplayItemType(ScrollbarPart); | 214 static DisplayItem::Type trackPiecePartToDisplayItemType(ScrollbarPart); |
197 | 215 |
198 private: | 216 private: |
199 static ScrollbarTheme& | 217 static ScrollbarTheme& |
200 nativeTheme(); // Must be implemented to return the correct theme subclass. | 218 nativeTheme(); // Must be implemented to return the correct theme subclass. |
201 static bool gMockScrollbarsEnabled; | 219 static bool gMockScrollbarsEnabled; |
202 }; | 220 }; |
203 | 221 |
204 } // namespace blink | 222 } // namespace blink |
205 #endif | 223 #endif |
OLD | NEW |