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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h

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

Powered by Google App Engine
This is Rietveld 408576698